0

当我将源代码转移到Win7 64-bit机器上BadImageFormatException时,我会在尝试编译和运行解决方案时得到一个 target AnyCPU

这不会发生在XP 32-bit.

问题是什么?

4

1 回答 1

1

It can typically occur when you changed the target framework of .csproj and reverted it back to what you started with.

Make sure 1 if supportedRuntime version="a different runtime from cs project target" under startup tag in app.config.

Make sure 2 That also means checking other autogenerated or other files in may be properties folder to see if there is no more runtime mismatch between these files and one that is defined in .csproj file.

These might just save you lot of time before you start trying different things with project properties to overcome the error.

于 2013-04-11T10:26:07.727 回答