.NET enable and disable Fusion log to investigate assembly loading issues
Posted by jpluimers on 2015/08/18
Had to investigate some Assembly Loading issues, so I wrote two batch files to enable and disable the .NET Fusion Log:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 0 /f |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
reg add "HKLM\Software\Microsoft\Fusion" /v EnableLog /t REG_DWORD /d 1 /f |
They modify the HKLM\Software\Microsoft\Fusion
key REG_DWORD
value EnableLog
.
A few notes:
- It is very important to turn of the Fusion log settings as soon as you are finished investigating. Fusion logs potentially take a lot of resources.
- When you have a .NET host like ISS, you have to restart that host (for instance by running iisreset)
- There is also Fuslogvw.exe Assembly Binding Log Viewer, but I like logging over viewing as logs are persistent.
- There are more values under
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Fusion
you can configure; see the answer by Gary Kindel on StackOverflow:DWORD ForceLog
set value to 1DWORD LogFailures
set value to 1DWORD LogResourceBinds
set value to 1String LogPath
set value to folder for logs e.g. C:\FusionLog\ (ensure the final backslash is there and the folder exists).
–jeroen
via:
Leave a comment