views:

7413

answers:

7

How to enable assembly bind failure logging (FUSION) in .NET.

A: 

Set the following registry value:

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion!EnableLog] (DWORD) to 1

To disable, set to 0 or delete the value.

Not that the entry probably won't exist - you'll have to create it. At least, I did when I was about to answer this question just before the crash this morning :)
Jon Skeet
What does the ! mean? Key or value? What about 64 bits systems?
Bruno Martinez
This is a rather incomplete answer.
garykindel
this doesn't actually work. the value is ForceLog not EnableLog, and there is an additional step needed here (see: http://thepursuitofalife.com/getting-assembly-bind-failure-logging-to-work/)
Marchy
actually, this does work...you just need to run iisreset afterwords to get it to work.
sunmorgus
iisreset? Really? Why would you reset IIS to get Fusion bind logging to work?
Norman H
+21  A: 

Add the following values to

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
String LogPath set value to folder for logs ie) C:\FusionLog\

Make sure you include the backslash after the folder name.

garykindel
+6  A: 

If you have the Windows SDK installed on your machine, you'll find the "Fusion Log Viewer" under Microsoft SDK\Tools (just type "Fusion" in the start menu on Vista or Windows 7). Launch it, click the Settings button, and select "Log bind failure" or "Log all binds".

Samuel Jack
Those buttons are disabled for me - why?
Tim Lovell-Smith
@Tim, not seen that before - could it be to do with Admin privileges? It is HKEY_LOCAL_MACHINE that is being modified after all.
Samuel Jack
Yup, I think that was probably it.
Tim Lovell-Smith
+3  A: 

I just posted this on a similar question - I think it's relevant here too.

I usually use the fusion log viewer (fuslogvw.exe from a visual studio command prompt or Fusion Log Viewer from the start menu) - my standard setup is:

  • Open fusion log viewer
  • Click settings
  • Check the Enable custom log path checkbox
  • Enter the location you want logs to get written to, e.g. c:\FusionLogs (Important: make sure that you have actually created this folder in the file system.)
  • Make sure that the right level of logging is on (I sometimes just select Log all binds to disk just to make sure things are working right)
  • Click OK
  • Set the log location option to Custom

Remember to turn of logging off once you're done!

Mike Goatly
+1  A: 

how do i find and open the fusion log viewer??

David Lee
+1  A: 

Gary's solutions worked for me although I also had to follow by resetting IIS.

Note I configured this in a clean environment where I didn't want to install SDKs and the like.

Michhes
Thanks! Your answer helped me. I was trying this under IIS also and having little luck, until I did 'Stop' and 'Start' on the server, and it started working.
Tim Lovell-Smith
A: 

where can I find this path?? HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion & is that for my local machine only?? as I've this error message from the site after publishing online

Rory