2012-07-19 51 views
0

我使用Microsoft的兩個dll程序集來比較xml。 XmlComparer.cs使用Microsoft.XmlDiffPatch,並且在Visual Studio中正確添加了兩個引用。 不過,我得到這個消息:固執的組裝,錯誤的關鍵?或者它是一個強名問題?

Error: Could not load file or assembly 'XmlDiffPatch, Version=1.0.8.28, Culture= neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The locate d assembly's manifest definition does not match the assembly reference. (Excepti on from HRESULT: 0x80131040) exception: System.IO.FileLoadException: Could not load file or assembly 'XmlDiff Patch, Version=1.0.8.28, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or on e of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040) File name: 'XmlDiffPatch, Version=1.0.8.28, Culture=neutral, PublicKeyToken=b03f 5f7f11d50a3a' at XmlCompareLib.XmlComparer.Compare(String comparisonOptions, String sourceX mlFileName, String changedXmlFileName, String resultHtmlViewFile) in C:\Users\xx\Documents\Visual Studio 2010\Projects\ConsoleApplication3\ConsoleAp plication3\XmlComparer.cs:line 214 at Ionic.Zip.Examples.ReadZip.Main(String[] args) in C:\Users\xx\ Documents\Visual Studio 2010\Projects\ConsoleApplication3\ConsoleApplication3\Pr ogram.cs:line 44

WRN: Assembly binding logging is turned OFF. To enable assembly bind failure logging, set the registry value [HKLM\Software\Md icrosoft\Fusion!EnableLog] (DWORD) to 1. Note: There is some performance penalty associated with assembly bind failure lo gging. To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fus ion!EnableLog].

我認爲這是一家擁有雄厚名稱有關。因爲我檢查了這兩個DLL,並且它們沒有很強的名字,所以我試圖爲程序集生成一個密鑰和強名稱,但它顯然不是同一個密鑰。我現在卡住了..

+0

也許這些DLL的號召另一個內部,其中之一是缺少DLL-S或有不同的版本?只是拋出主意。 – Leri 2012-07-19 12:39:22

回答

0

這通常是我打開Fusion記錄器並記錄所有綁定的點。 Fusion的註銷通常會更清晰一些。

要啓用Fusion日誌記錄,可以打開VisualStudio命令提示符並運行「fuslogvw.exe」。我最終安裝在:

C:\Program Files\Microsoft SDKs\Windows\v7.1\Bin\NETFX 4.0 Tools\x64\FUSLOGVW.exe

但這可能會根據您的安裝而有所不同。

然後點擊「設置」按鈕工具,並通過翻轉單選按鈕啓動日誌記錄,然後運行你的應用程序,然後點擊融合記錄器中的「刷新」,它會顯示所有發生的綁定和那些失敗)。

記得回去到設置窗口,並關閉日誌記錄,當你完成:)