我在Windows7的VS2010上编译了一个C#程序,然后在另一台32位机器上运行文件(全部取自编译的bin\Debug目录)。
调试目录中的文件还包含此程序所依赖的Microsoft.Office.Project.Server.Library.dll文件。
在VS2010项目的构建配置中,平台设置为x86。然而,在32位机器上,它会产生一个System.BadImageFormatException。
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly
'Microsoft.Office.Project.Server.Library, Version=12.0.0.0, Culture=neutral,
PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The module was expected to
contain an assembly manifest. File name: 'Microsoft.Office.Project.Server.Library,
Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c'这可能是什么原因呢?
发布于 2012-01-05 07:19:11
我仍然认为这是x86和x64的问题。可执行文件是否依赖于其他x64库?
发布于 2012-01-05 07:15:10
可能是问题机器的.NET框架与构建机器的版本不同。
https://stackoverflow.com/questions/8735467
复制相似问题