好吧,伙计们,这个真的很奇怪:在为我的 Web 数据库重建 Lucene 索引时,我的 Sitecore 实例 (6.4.1) 正在打盹。查看日志文件,在索引重建开始之前,一切都很顺利,然后日志中充满了 MEGABYTES 的以下堆栈跟踪,一遍又一遍地重复:
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)
([OTHER PROJECT LIBRARY].dll 为保护隐私而被缩短,但它是该项目的 sitecore/website/bin 目录的完整路径)
真正奇怪的是,在解决方案或整个文件树(项目和网站文件夹)中都没有以任何方式、形状或形式引用此 DLL。
但关键是:这个 DLL 甚至不是来自同一个项目,它来自我在我的工作站上的另一个项目(它与这个项目一起在它自己的 Sitecore 实例中运行)。
这怎么可能发生?项目 A 试图从项目 B 中引用一个 DLL,而这个 DLL 没有以任何方式被引用。我什至检查了我数据库中的 EventQueue 表......我真的开始失去理智了。