1

.net3.5プロジェクトの.net2.0で構築されたアセンブリを参照しています。Windows XPマシンでは正常に動作しますが、Win200364ビットに展開する場合

以下のエラーが発生します

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

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

プロジェクトはWinxp32ビットマシン上に構築され、wixインストーラーを使用して展開されます。アセンブリを手動で置き換えようとしましたが、機能しませんでした。

4

1 に答える 1

2

Wrapperアセンブリのビルドプロパティを確認する必要があります。32ビット(x86)に設定されていると思います。64ビットCLRにロードするには、AnyCpuまたはx64のいずれかである必要があります。

これが実際にアンマネージコードのラッパーである場合は、アセンブリの2つの異なるバージョン(1つは32ビット用、もう1つは64ビット用)が必要になる可能性があります。

もう1つの方法は、アプリケーションを32ビットに変更することです。実行しているアプリケーションの種類や、それが適切かどうかは明確ではありませんが、検討する価値はあります。

于 2012-12-06T14:00:14.007 に答える