Q:

Sitecore instance needs DLL from other project...?

Alright guys and gals, this one is really weird: when rebuilding the Lucene indexes for my Web database, my Sitecore instance (6.4.1) is taking a dirt nap. Looking at log files, everything is peachy until the index rebuild starts, and then the log is filled with MEGABYTES of the following stack trace repeated over and over:
ManagedPoolThread #6 15:57:06 ERROR Failed to sort items
Exception: System.IO.FileNotFoundException
Message: Could not load file or assembly 'file:///[OTHER PROJECT LIBRARY].dll' or one of its dependencies. The system cannot find the file specified.
Source: mscorlib
    at System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection, Boolean suppressSecurityChecks)
    at System.Reflection.RuntimeAssembly.InternalLoadFrom(String assemblyFile, Evidence securityEvidence, Byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm, Boolean forIntrospection, Boolean suppressSecurityChecks, StackCrawlMark& stackMark)
    at System.Reflection.Assembly.LoadFrom(String assemblyFile)
    at Sitecore.Reflection.ReflectionUtil.LoadAssembly(String name)
    at Sitecore.Reflection.ReflectionUtil.CreateObject(String assembly, String className, Object[] parameters)
    at Sitecore.Reflection.ReflectionUtil.CreateObject(String typeName, Object[] parameters)
    at Sitecore.Data.Comparers.ComparerFactory.GetComparer(String sortingId, Database database)
    at Sitecore.Data.Comparers.ComparerFactory.GetComparer(Item item)
    at Sitecore.Configuration.Factory.GetItemComparer(Item item)
    at Sitecore.Data.Managers.ItemProvider.Sort(ItemList items, Item owner)

(the [OTHER PROJECT LIBRARY].dll was shortened for privacy, but it's a full path to this project's sitecore/website/bin directory)
The really, really weird thing is that this DLL isn't referenced in any way, shape, or form in both the solution or the entire filetree (both the project and website folders).
But here's the punchline: this DLL isn't even from the same project, it's from a different project I have on my workstation (which is running in its own Sitecore instance alongside this project). 
How could this happen? Project A is trying to reference a DLL from Project B, and this DLL isn't referenced in any way. I've even checked the EventQueue tables in my databases... I'm really starting to lose my mind here.

A:

Looking at the attached stacktrace you can see that the problem is that Sitecore tries to find  a proper comparer while sorting some items. It looks like one of your items has the "Type" field set to the class name from some external library. Maybe someone pasted some wrong class name from the clipboard and hasn't noticed it?
Try to execute this query to find the name and the id of the Item with wrong field value set and the value of field:
SELECT 
    ii.Name, ii.ID, f.Value 
FROM 
    [Sitecore_Master].[dbo].[SharedFields] f,
    [Sitecore_Master].[dbo].[Items] i,
    [Sitecore_Web].[dbo].[Items] ii
WHERE f.FieldId = i.ID 
    AND i.Name = 'Type'
    AND ii.ID = f.ItemId
    AND f.Value LIKE '%[OTHER ASSSEMBLY NAME WITHOUT DLL].%'

Change the name of the database to your database and use the name of the assembly that appears in the logs. You can also try this query with other databases and without AND i.Name = 'Type' line.
The other way is to override the ItemProvider class as follows:
namespace My.Namespace
{
    public class MyItemProvider : Sitecore.Data.Managers.ItemProvider
    {
        protected override void Sort(Sitecore.Collections.ItemList items, Sitecore.Data.Items.Item owner)
        {
            try
            {
                base.Sort(items, owner);
            }
            catch (System.Exception exc)
            {
                Sitecore.Diagnostics.Log.Error("Exception while sorting children of " + owner.Paths.FullPath, exc, this);
            }
        }
    }
}

and change in your sitecore.config file:
<itemManager defaultProvider="default">
    <providers>
        <clear/>
        <add name="default" type="My.Namespace.MyItemProvider, My.Assembly"/>
    </providers>
</itemManager>

You should now see in logs which item is causing problems.

