2014-01-13 40 views
1

指定的模式無效。錯誤:(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. 

這個版本也沒有配置文件。我甚至刪除了這個項目的參考並重新添加。但沒有任何工作。我哪裏錯了?

回答

0

這並不多,但FSLogVw輸出顯示調用程序集爲EF。你在使用和edmx?如果是這樣,你可能想要在XML視圖(而不是設計視圖)中打開它,並查看是否有對你的程序集的引用。你提到你已經檢查過了.config文件,這樣規則就出來了。

+0

不,我使用的代碼首先,加入剩餘的日誌。 –

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