BadImageFormatException or An attempt was made to load a program with an incorrect format
2018-01-27 01:52
507 查看
c# pinvoke C++程序异常:
BadImageFormatException or “An attempt was made to load a program with an incorrect format”
原因
dll平台不兼容。x64 编译 的c++ dll 而 c# 项目里设置了prefer 32bit , 或 x32 编译的 c++ 被 c#调用.
解决方案:
c#的platform指向与c++相同的OS编译环境即可。
BadImageFormatException or “An attempt was made to load a program with an incorrect format”
原因
dll平台不兼容。x64 编译 的c++ dll 而 c# 项目里设置了prefer 32bit , 或 x32 编译的 c++ 被 c#调用.
解决方案:
c#的platform指向与c++相同的OS编译环境即可。
相关文章推荐
- ASP.NET: System.BadImageFormatException: An attempt was made to load a program with an incorrect format. on Win7 64bit
- (C#) System.BadImageFormatException: An attempt was made to load a program with an incorrect format.
- Could not load file or assembly ... An attempt was made to load a program with an incorrect format.
- Could not load file or assembly An attempt was made to load a program with an incorrect format.
- An attempt was made to load a program with an incorrect format” even when the platforms are the same
- ASP.NET 解决An attempt was made to load a program with an incorrect format.问题
- An attempt was made to load a program with an incorrect format
- 解决An attempt was made to load a program with an incorrect format.问题
- 64bit系统运行32位Web程序出现错误:An attempt was made to load a program with an incorrect format
- Attempt to load Oracle client libraries threw BadImageFormatException. This problem will occur when running in 64 bit mode with the 32 bit Oracle client components installed.
- NAMESPACE_ERR: An attempt is made to create or change an object in a way which is incorrect with regard to namespaces.
- [IIS] Attempt to load Oracle client libraries threw BadImageFormatException.
- [IIS] Attempt to load Oracle client libraries threw BadImageFormatException.
- Unhandled Exception: System.BadImageFormatException: Could not load file or assembly (2008R2配置x64website)
- Unhandled Exception: System.BadImageFormatException: Could not load file or assembly
- Could not load file or assembly 'System.Data.SQLite' or one of its dependencies. An attempt was made
- System.BadImageFormatException: Could not load file or assembly
- java.lang.Exception: Socket bind failed: [730013] An attempt was made to acc
- BadImageFormatException : Could not load file or assembly or one of its dependencies.
- ehcache 在集群环境下 出现 Cause was not due to an IOException or NotBoundException