指定的模式无效 - 异常

时间:2014-01-13 21:18:55

标签: c# .net wpf mef fuslogvw

  

指定的架构无效。错误:(0,0):错误0004:不能   加载文件或程序集'JIMSDAL,Version = 6.0.5126.47,Culture = neutral,   PublicKeyToken = 9054b539c49e6e2e'或其依赖项之一。该   找到程序集的清单定义与程序集不匹配   参考。 (HRESULT异常:0x80131040)

为什么我得到此异常,我检查了JIMSDAL的每个依赖项目,并且它们引用了正确的更新版本6.0.1.0。

我还检查了fuslogvw.exe,但没有帮助。它说

The operation failed.
Bind result: hr = 0x80131040. No description available.

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dll
Running under executable  X:\yyyyy\Build\Debug\JIMS.vshost.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: DisplayName = JIMSDAL, Version=6.0.5126.47, Culture=neutral, PublicKeyToken=9054b539c49e6e2e
 (Fully-specified)
LOG: Appbase = file:///X:/yyyyy/Build/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
    Calling assembly : EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: X:\yyyyy\Build\Debug\JIMS.vshost.exe.Config
LOG: Using host configuration file: 
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.
LOG: Post-policy reference: JIMSDAL, Version=6.0.5126.47, Culture=neutral, PublicKeyToken=9054b539c49e6e2e
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///X:/yyyyy/Build/Debug/JIMSDAL.DLL.
LOG: Assembly download was successful. Attempting setup of file: X:\yyyyy\Build\Debug\JIMSDAL.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: JIMSDAL, Version=6.0.0.0, Culture=neutral, PublicKeyToken=9054b539c49e6e2e
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Run-from-source setup phase failed with hr = 0x80131040.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.

此版本也没有配置文件。我甚至删除了这个项目的参考并重新添加。但没有任何作用。我哪里错了?

2 个答案:

答案 0 :(得分:0)

这不是很多,但FSLogVw输出显示调用程序集为EF。你在用和edmx吗?如果是这样,您可能希望在XML视图(而不是设计视图)中打开它,并查看是否在那里有对程序集的引用。您提到您已经检查过.config文件,因此规则已经过了。

答案 1 :(得分:0)

您正在引用JIMSDAL, Version=6.0.5126.47,但调用程序集找到了JIMSDAL, Version=6.0.0.0。过去,当项目引用与编译程序集的引用混合时,我发生了这种情况,但还有其他方法可以实现。寻找对JIMSDAL的多个引用,并确保它们都指向同一个东西。

This question (https://stackoverflow.com/questions/5600904/net-dll-dependency-of-same-file)描述了类似的问题,您可能需要查看。

这是另一个问题,其中包含一些有用的建议:Project References DLL version hell