将 Lucene.net 和 Lucene.net Contrib 添加到 C# MVC3 后,我在第一次成功运行后收到以下消息。收到此错误后,我需要完全擦除 C:\Users\Me\AppData\Local\Temp\Temporary ASP.NET 文件,然后才能再次运行该项目。
我已经尝试手动删除 Lucene 文件(包括我的项目中的引用),然后重新安装它们 - 使用 NuGet 和手动 - 但它总是相同的情况;项目运行一次后,我开始收到以下错误:
注意:Contrib.Regex 是 Lucene.net Contrib 的一部分。
Server Error in '/' Application.
Could not load types from assembly Contrib.Regex, Version=2.9.4.0, Culture=neutral, PublicKeyToken=85089178b9ac3181, errors:
Exception: System.IO.FileLoadException: Could not load file or assembly 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181'
=== Pre-bind state information ===
LOG: User = rcw7\Me
LOG: DisplayName = Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181
(Fully-specified)
LOG: Appbase = file:///C:/Development/Projects/Foobar/Foobar/
LOG: Initial PrivatePath = C:\Development\Projects\Foobar\Foobar\bin
Calling assembly : Contrib.Regex, Version=2.9.4.0, Culture=neutral, PublicKeyToken=85089178b9ac3181.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Development\Projects\Foobar\Foobar\web.config
LOG: Using host configuration file: C:\Users\Me\Documents\IISExpress\config\aspnet.config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181
LOG: Attempting download of new URL file:///C:/Users/Me/AppData/Local/Temp/Temporary ASP.NET Files/root/e9b4cfa4/edfa73f8/Lucene.Net.DLL.
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Exception: System.IO.FileLoadException: Could not load file or assembly 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)
File name: 'Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181'
此处的完整输出:http: //pastebin.com/Vbu4VK7B
最初我认为这是我的开发环境本地的问题,但是在重建项目并将其复制到我们的服务器后,我得到了同样的错误。
关于如何克服这个问题的任何建议?:-)