Fusion Log Viewer

posted Jun 16, 2014, 10:09 AM by Lesley Bross
When debugging my new Windows Form application, I was unable to instantiate a RasterFactory from the Landis RasterIO.Gdal RasterFactory. After perusing the developer message boards I was 80% convinced that it was an assembly binding issue. That is, my computer was missing or had a different version of an assembly that was required by the RasterFactory. The developer message boards made mention of the Fusion Log Viewer from Microsoft. This assembly binding log helps diagnose why an assembly cannot be located at run-time. Although this tool didn't completely fix my problem, it pointed me in the right direction by displaying the version of the gdal_csharp.dll that was installed on my computer, and the version that the RasterFactory was expecting.

This tool installs with Visual Studio and with the Windows SDK. I'm still not sure why it works but it appears that you just have to run it as an Administrator and it will automatically hook-in to your debugger. The following links offer additional documentation and an installation hack if you need to install it.
http://msdn.microsoft.com/en-us/library/e74a18c4(v=vs.90).aspx
http://stackoverflow.com/questions/1012252/using-fuslogvw-exe-on-a-machine-with-no-visual-studio-installed

Sample output for my gdal_csharp.dll binding issue:
*** Assembly Binder Log Entry  (6/10/2014 @ 9:49:14 AM) ***

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

Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v2.0.50727\mscorwks.dll
Running under executable  C:\Docs\Lesley\Landis\code\branches\lbross\Widgets3\bin\Debug\Widgets3.vshost.exe
--- A detailed error log follows. 

=== Pre-bind state information ===
LOG: User = Snootypurse\lesleyb
LOG: DisplayName = gdal_csharp, Version=1.0.4704.30777, Culture=neutral, PublicKeyToken=db5a52b08dc5b321
 (Fully-specified)
LOG: Appbase = file:///C:/Docs/Lesley/Landis/code/branches/lbross/Widgets3/bin/Debug/
LOG: Initial PrivatePath = NULL
LOG: Dynamic Base = NULL
LOG: Cache Base = NULL
LOG: AppName = NULL
Calling assembly : Landis.RasterIO.Gdal, Version=1.0.4815.34360, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: Using application configuration file: C:\Docs\Lesley\Landis\code\branches\lbross\Widgets3\bin\Debug\Widgets3.vshost.exe.Config
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v2.0.50727\config\machine.config.
LOG: Post-policy reference: gdal_csharp, Version=1.0.4704.30777, Culture=neutral, PublicKeyToken=db5a52b08dc5b321
LOG: GAC Lookup was unsuccessful.
LOG: Attempting download of new URL file:///C:/Docs/Lesley/Landis/code/branches/lbross/Widgets3/bin/Debug/gdal_csharp.DLL.
LOG: Assembly download was successful. Attempting setup of file: C:\Docs\Lesley\Landis\code\branches\lbross\Widgets3\bin\Debug\gdal_csharp.dll
LOG: Entering run-from-source setup phase.
LOG: Assembly Name is: gdal_csharp, Version=1.0.4704.32492, Culture=neutral, PublicKeyToken=db5a52b08dc5b321
WRN: Comparing the assembly name resulted in the mismatch: Revision Number
ERR: The assembly reference did not match the assembly definition found.
ERR: Failed to complete setup of assembly (hr = 0x80131040). Probing terminated.
Comments