我使用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,並且它們沒有很強的名字,所以我試圖爲程序集生成一個密鑰和強名稱,但它顯然不是同一個密鑰。我現在卡住了..
也許這些DLL的號召另一個內部,其中之一是缺少DLL-S或有不同的版本?只是拋出主意。 – Leri 2012-07-19 12:39:22