How to turn on assembly binding logging in C#?

可紊 提交于 2020-01-14 17:50:42

问题


I ran into this error and couldn't figure what's missing:

{"Could not load file or assembly 'xxxxx, Version=1.0.0.42, Culture=neutral, PublicKeyToken=c5067b3d1110b13c' or one of its dependencies. The located assembly's manifest definition does not match the assembly reference. (Exception from HRESULT: 0x80131040)":"xxxxx, Version=1.0.0.42, Culture=neutral, PublicKeyToken=c5067b3d1110b13c"}

In the detailed exception window, it also tells me:

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

However, I couldn't make it work. I found another post about this here. I tried those entries:

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\

But it still doesn't work. Actually, I also set EnableLog to 1.

What did I do wrong? Can somebody please help. I'm using C# express 2010 in WinXP.


回答1:


http://www.codeproject.com/Tips/141281/WRN-Asssembly-binding-logging-is-turned-OFF

Does this help?




回答2:


Try running C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\FUSLOGVW.exe to see if you have logs.



来源:https://stackoverflow.com/questions/4150980/how-to-turn-on-assembly-binding-logging-in-c

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!