The WRN: Assembly binding logging is turned off message is annoying but assembly binding logging can be extremely helpful when you need to know how .NET is (or isn't) locating the assemblies you've referenced. The message is annoying because, if you're like me, you never have logging enabled and the registry key cited is a bit unusual:
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
What does the exclamation mark mean? Presumably EnableLog is a DWORD in the Fusion key but it's all a bit unclear for my liking. Once you've set this DWORD, you need to figure out what to do next and for many people that will likely involve firing up the Fusion Log Viewer fuslogvw.exe or the Windows/.NET SDK. But then what?
Gary Kindel was kind enough to post the following details in response to a related Stack Overflow question:
Add the following values to HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
String LogPath set value to folder for logs ie) C:\FusionLog\
Make sure you include the backslash after the folder name. I also found an IISRESET was necessary in a web context.
Since I wanted to enable this logging in an environment without Visual Studio or the Windows SDK installed, the above option was clean and lightweight. Log files were dumped to the expected location in .html format and it was then a case of locating the assembly I was interested in… and, oh yeah, fixing the problem ;-) The issue was also detailed in the ASP.NET error message returned by IIS.
Advanced geeks: because Fusion logging supposedly affects performance, you might want to create a reg file/batch script to toggle logging on and off. Here's a starting point—put this into a file called EnableFusionLogging.reg and double-click to run it:
Windows Registry Editor Version 5.00
I actually call this from a batch script which also resets IIS and I have a mirror reg file that disables logging.
If you found this post helpful, please support my advertisers: