And*_*ske 13 .net-4.0 visual-studio-2010 entity-framework-4.3
我一直试图解决过去12小时的装配绑定问题,运气不大.上周,我已经将解决方案中的所有项目从EF 4.1.0.0升级到EF 4.3.1.0.我今天早上在现有的测试项目中添加了一些测试,清理并重新编译了解决方案.所有项目都在编译时没有任何警告或错误.在我的实体框架调用项目中的任何地方,我收到以下异常:
初始化方法NutricityPPCTests.Common.DizzleProductExtensionsTests.TestSetup抛出异常.System.IO.FileLoadException:System.IO.FileLoadException:无法加载文件或程序集'EntityFramework,Version = 4.1.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089'或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(HRESULT异常:0x80131040).
我启动了融合程序集绑定日志查看器,并找到了与异常对应的日志条目.我已经验证我的测试项目,MOMData项目都引用了正确的EF4.3.1.0程序集.我确认项目文件中没有引用EF 4.1.0.0.我删除了两个项目中obj和bin目录的内容.该项目已经清理和重建了很多次,我的硬盘可能会在明天发布.
*** Assembly Binder Log Entry (3/22/2012 @ 5:55:11 PM) ***
The operation failed.
Bind result: hr = 0x80131040. No description available.
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll
Running under executable c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\QTAgent32.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = NUTRICITY0\awolske
LOG: DisplayName = EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
(Fully-specified)
LOG: Appbase = file:///C:/Users/awolske/Documents/NutricityWorkspace/Nutricity/NutricityPPCTests/bin/Release
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = QTAgent32.exe
Calling assembly : MomData, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Users\awolske\Documents\NutricityWorkspace\Nutricity\NutricityPPCTests\bin\Release\NutricityPPCTests.DLL.config
LOG: Using host configuration file:
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config.
LOG: Post-policy reference: EntityFramework, Version=4.1.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Users/awolske/Documents/NutricityWorkspace/Nutricity/NutricityPPCTests/bin/Release/EntityFramework.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Users\awolske\Documents\NutricityWorkspace\Nutricity\NutricityPPCTests\bin\Release\EntityFramework.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: EntityFramework, Version=4.3.1.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
WRN: Comparing the assembly name resulted in the mismatch: Minor Version
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Run Code Online (Sandbox Code Playgroud)
我还应该在哪里寻找旧的引用程序集?!?欢迎任何帮助,非常感谢!在此先感谢您的时间!
Ela*_*son 17
将以下内容添加到web.config文件中:
<runtime>
<assemblyBinding>
<dependentAssembly>
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.3.1.0" newVersion="4.3.1.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
Run Code Online (Sandbox Code Playgroud)
小智 1
我有同样的错误。我的解决方案中的大多数项目都引用了 Entity Framework 4.3.0.0 dll,但是当我检查解决方案中所有项目的引用时,我发现一些项目引用了 Entity Framework 4.1.0.0 dll。删除它们并用对 Entity Framework 4.3.0.0 dll 的新引用替换它们可以解决该问题。
| 归档时间: |
|
| 查看次数: |
9838 次 |
| 最近记录: |