Getting Assembly Bind Failure Logging to Work

From my last post, you can see that there is a warning shown when I run the compiled .exe:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'gtk-sharp, Uersion=2.10.0.0, Culture=neutral, PublicKeyToken=35el0l95dab3c99f' or one of its dependencies.

Then some helpful text about setting a Registry flag (HKLM/Software/Microsoft/Fusion/EnableLog) to turn on assembly bind failure logging. Unfortunately, it doesn’t work — at least with Mono. To take Mono out of the equation, I followed this helpful post from Thottam R. Sriram, but got the same result.

So, in poking around, I find this page from MSFT that says that the value name should be ForceLog, NOT EnableLog. Sheesh! But when I rename the value, it still doesn’t work. Reading further on down the MSFT page, i see this:

To log bind failures to satellite assemblies

  • Set the HKLM\Software\Microsoft\Fusion\LogResourceBinds registry value to 1 (the value is a DWORD).

By default, Fuslogvw.exe does not log failed attempts to locate satellite assemblies. Setting this registry key enables this feature.

Adding that DWORD value and setting it to 1 did the trick. Now I get:

Mono version 1.2.5.2 Build 0
Prepending 'C:\PROGRA~1\MONO-1~1.2\bin' to PATH
C:\Users\Anthony\Documents>x.exe
Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'gtk-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' or one of its dependencies. The system cannot find the file specified. File name: 'gtk-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f' at X.Main(String[] args)
Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v2.0.50727\mscorwks.dll
Running under executable C:\Users\Anthony\Documents\x.exe
--- A detailed error log follows.
=== Pre-bind state information ===
LOG: User = anthonys-m1330\Anthony
LOG: DisplayName = gtk-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f
(Fully-specified)
LOG: Appbase = file:///C:/Users/Anthony/Documents/
LOG: Initial PrivatePath = NULL
Calling assembly : x, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null.
===
LOG: This bind starts in default load context.
LOG: No application configuration file found.
LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v2.0.50727\config\machine.config.
LOG: Post-policy reference: gtk-sharp, Version=2.10.0.0, Culture=neutral, PublicKeyToken=35e10195dab3c99f
LOG: Attempting download of new URL file:///C:/Users/Anthony/Documents/gtk-sharp.DLL.
LOG: Attempting download of new URL file:///C:/Users/Anthony/Documents/gtk-sharp/gtk-sharp.DLL.
LOG: Attempting download of new URL file:///C:/Users/Anthony/Documents/gtk-sharp.EXE.
LOG: Attempting download of new URL file:///C:/Users/Anthony/Documents/gtk-sharp/gtk-sharp.EXE.

Advertisements

3 Responses to “Getting Assembly Bind Failure Logging to Work”


  1. 1 Cristian January 31, 2008 at 6:22 am

    Hey!

    I’m having the same problem, did u find any solution?

    Cheers


  1. 1 Cropper – Not much better « The Pursuit of a Life Trackback on December 10, 2007 at 8:36 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s





%d bloggers like this: