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

如何在.NET中启用程序集绑定失败日志记录(Fusion)?


Add the following values to

HKEY_LOCAL_MACHINESOFTWAREMicrosoftFusion
Add:
DWORD ForceLog set value to 1
DWORD LogFailures set value to 1
DWORD LogResourceBinds set value to 1
DWORD EnableLog set value to 1
String LogPath set value to folder for logs (e.g. C:FusionLog)

Make sure you include the backslash after the folder name and that the Folder exists .

You need to restart the program that you're running to force it to read those registry settings.

BTW, don't forget to turn off fusion logging off when not needed.


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, for example, 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!

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


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

    If these buttons are disabled, go back to the start menu, right-click the Log Viewer, and select "Run as Administrator".

    链接地址: http://www.djcxy.com/p/6428.html

    上一篇: 我如何获得组件文件版本

    下一篇: 如何在.NET中启用程序集绑定失败日志记录(Fusion)