2010-11-11 114 views
3

我遇到了這個錯誤,想不出有什麼遺漏:如何打開C#中的程序集綁定日誌記錄?

{"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"} 

在詳細的異常窗口,它也告訴我:

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]. 

但是,我不能使它工作。我發現另一篇關於這個here的帖子。我試過這些條目:

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\ 

但它仍然不起作用。實際上,我也將EnableLog設置爲1.

我做錯了什麼?有人可以請幫忙嗎?我在WinXP中使用C#express 2010。

回答

1

嘗試運行C:\Program Files\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\FUSLOGVW.exe以查看您是否有日誌。

+0

非常感謝您的提示。我沒有在... \ v7.0A \ ...文件夾中找到FusLogVw.exe,我在... \ v6.0A \ ...文件夾中找到了一個。但是,即使我的C#在異常窗口中顯示報告,該日誌查看器也不會顯示任何失敗。如果我更改設置以將所有綁定記錄到磁盤,則可以看到大約20個程序集已加載,並且都說「操作成功」。在C#異常窗口中,它仍然告訴我'程序集綁定記錄被關閉'。我是否必須在... \ v7.0A \ ...文件夾中找到一個文件夾,因爲我使用的是C#express 2010? – newman 2010-11-11 12:33:53

+0

我不太確定,因爲我不清楚Fusion如何對待v2.0和v4.0程序集(如果有的話)。一個想法是安裝Win7 SDK並嘗試從那裏運行Fuslogvw.exe,因爲它可能依賴於運行時。然而,這只是猜測。奇怪的是,你得到2個不同的結果... – codekaizen 2010-11-11 18:24:25

相關問題