2012-06-21 41 views
0

我使用x86平臺目標編譯了整個項目。當我將.exe和參考DLL複製到服務器上並從服務器cmd窗口運行.exe時,它工作正常。UNC路徑和未處理的異常:C#中的System.BadImageFormatException

我們的要求是將exe和dll複製到某個網絡路徑上,並使用UNC路徑在服務器上執行exe。當我使用UNC路徑執行時,出現錯誤:

Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'XXXX, Version=3.0.10.19399, Culture=neutral, PublicKeyToken=null' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'XXXX, Version=3.0.10.19399, Culture=neutral, PublicKeyToken=null'

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

有人可以幫忙嗎?

+1

當您啓用大會綁定日誌記錄消息建議時會發生什麼? – Dai

回答

0

我只是猜測現在,但我可能會責怪路徑本身 - 這很可能是「不可信」的,原因不明。啓用大會綁定日誌記錄(提示:谷歌:))找出發生了什麼