gpt4 book ai didi

c# - Entity Framework 和 Lucene 的 DLL hell

转载 作者:太空宇宙 更新时间:2023-11-03 13:48:30 24 4
gpt4 key购买 nike

我有一个 ASP.NET MVC 4 项目,我需要更新它才能使用 Lucene 3.0。我需要手动设置框架以使用 .NET Framework 4.5,因为我使用的是需要此版本的最新 Windows Azure 库。一切正常,除了我使用 Entity Framework 添加新数据模型时。我可以使用 Entity Framework 成功添加新的数据模型。然而,当我尝试执行一个基本的存储过程(它只执行一个查询)时,我得到一个运行时异常。异常(exception)情况是:

System.Reflection.ReflectionTypeLoadException
Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.

当我查看 LoaderExceptions 属性时,我看到以下内容:

[0] {"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)":"Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181"}  System.Exception {System.IO.FileLoadException}

[1] {"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)":"Lucene.Net, Version=2.9.4.1, Culture=neutral, PublicKeyToken=85089178b9ac3181"} System.Exception {System.IO.FileLoadException}

奇怪的是,我在任何地方都找不到对 Lucene.Net 版本 2.9.4.1 的单一引用。我确实在我的应用程序中引用了 Lucene.Net 的 3.0.3.0 版本。谁能告诉我 2.9.4.1 版本的文件在哪里引用?我查看了以下位置:

MyProject.csproj 
Web.config
Global.asax.cs
packages.config

我该如何解决这个问题?我已经为此苦恼了 2 天。太奇怪了。非常感谢您提供的任何帮助。

最佳答案

我不知道这个问题的确切答案,但如果它真的难倒你(而且你很幸运,这两个版本是兼容的),你可以将对 2.9.4.1 的任何请求重定向到你拥有的版本将绑定(bind)重定向添加到您的配置文件。

参见:http://msdn.microsoft.com/en-us/library/433ysdt1.aspx

关于c# - Entity Framework 和 Lucene 的 DLL hell ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14462703/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com