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

后端 未结 13 3198
难免孤独
难免孤独 2020-11-21 04:50

How do I enable assembly bind failure logging (Fusion) in .NET?

13条回答
  •  面向向阳花
    2020-11-21 05:23

    You can run this Powershell script as administrator to enable FL:

    Set-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name ForceLog         -Value 1               -Type DWord
    Set-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogFailures      -Value 1               -Type DWord
    Set-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogResourceBinds -Value 1               -Type DWord
    Set-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogPath          -Value 'C:\FusionLog\' -Type String
    mkdir C:\FusionLog -Force
    

    and this one to disable:

    Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name ForceLog
    Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogFailures
    Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogResourceBinds
    Remove-ItemProperty -Path HKLM:\Software\Microsoft\Fusion -Name LogPath
    

提交回复
热议问题