Wednesday, April 30, 2014

Assembly Binding Log Viewer - fuslogvw.exe

When assembly binding fails, typically with an exception (usually, FileNotFoundException, FileLoadException, or BadImageFormatException).

At this point the Assembly Binding Log Viewer (fuslogvw.exe) which comes with .NET framework or The Microsoft .NET Framework SDK, I used it with .NET 4.5 the last time and through Developer Command Prompt for VS2013 which ran as Administrator.

When the binding happens, it looks like a Fusion, and "the Assembly Binding Log Viewer" will show you all assembly binds providing the HKLM\Software\Microsoft\Fusion\ForceLog registry value gets set to 1.

To force it to log I did the following setting in registery (by regedit.exe) HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion Add: DWORD ForceLog set value to 1 DWORD LogFailures set value to 1 DWORD LogResourceBinds set value to 1

My problem which caught me was about signing assemblies which were strongly named in addition to assembly versioning.

Sample log will be something like the following (but this one is a successful binding sample):
*** Assembly Binder Log Entry (4/28/2014 @ 2:30:11 PM) *** The operation was successful. Bind result: hr = 0x0. The operation completed successfully. Assembly manager loaded from: C:\Windows\Microsoft.NET\Framework\v4.0.30319\clr.dll Running under executable C:\Program Files (x86)\IIS Express\iisexpress.exe --- A detailed error log follows. === Pre-bind state information === LOG: DisplayName = Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (Fully-specified) LOG: Appbase = file:///D:/appBranch/DEV-R2/LT/Services/Authentication/Authentication/ LOG: Initial PrivatePath = D:\appBranch\DEV-R2\LT\Services\Authentication\Authentication\bin LOG: Dynamic Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f388dcb0 LOG: Cache Base = C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\f388dcb0 LOG: AppName = 90e27310 Calling assembly : (Unknown). === LOG: This bind starts in default load context. LOG: Using application configuration file: D:\LandTitles\DEV-R2\LT\Services\Authentication\Authentication\web.config LOG: Using host configuration file: C:\Users\Farhad.Bayanati\Documents\IISExpress\config\aspnet.config LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework\v4.0.30319\config\machine.config. LOG: Post-policy reference: Microsoft.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a LOG: Found assembly by looking in the GAC. LOG: Binding succeeds. Returns assembly from C:\Windows\Microsoft.Net\assembly\GAC_MSIL\Microsoft.CSharp\v4.0_4.0.0.0__b03f5f7f11d50a3a\Microsoft.CSharp.dll. LOG: Assembly is loaded in default load context.

Share/Bookmark

No comments: