I’m using two dll assembly from Microsoft to compare Xml. XmlComparer.cs uses Microsoft.XmlDiffPatch and the two references are correctly added in Visual Studio.
However I get this message :
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
44WRN: 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].
I think it is related with Strong Name. Because I checked the two DLL and they are not strong named so I tried to generate a key and strong name the assembly but it was obviously not the same key. I’m stuck now..
This is usually the point where I turn on the Fusion logger and log all the bindings. The logs out of Fusion are usually a little clearer on what it is doing.
To enable Fusion logging, you can open a VisualStudio command prompt, and run “fuslogvw.exe”. Mine ends up being installed at:
but that may differ based on your install.
You then click the “Settings” button int hat tool, and enable logging by flipping a radio button, then running your app, then clicking “Refresh” in fusion logger, and it will show you all the bindings that happened (and ones that failed).
Remember to go back into the settings window and turn off logging when you are done 🙂