1

I am referencing to an assembly built on .net 2.0 in .net 3.5 project. Its working fine on Windows xp machine, but when deploying on Win2003 64 bit

I am getting error below

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

Project is built on Win xp 32 bit machine and then deployed using wix installer, Tried manually replacing assembly but didn't work.

4

1 回答 1

2

您应该检查程序集的构建属性Wrapper。我怀疑它设置为 32 位(x86)。您需要它是 AnyCpu 或 x64 才能加载到 64 位 CLR。

现在,如果它实际上是非托管代码的包装器,您可能需要两个不同版本的程序集——一个用于 32 位,一个用于 64 位。

另一种选择是将您的应用程序更改为 32 位。目前尚不清楚您正在运行哪种应用程序,或者这是否合适 - 但值得考虑。

于 2012-12-06T14:00:14.007 回答