VB.net程序System.BadImageFormatException: 试图加载格式不正确的程序
来源:互联网 发布:mac xml 格式化工具 编辑:程序博客网 时间:2024/06/01 16:39
用DllImport引用的时候,函数修改如下
[DllImport("test.dll",CharSet = CharSet.Ansi)]
public static extern bool ReadCSE(string lpszPathName, [In, Out] short[] data, int length);
在32位平台上可以正常运行。
[DllImport("test.dll",CharSet = CharSet.Ansi)]
public static extern bool ReadCSE(string lpszPathName, [In, Out] short[] data, int length);
在32位平台上可以正常运行。
在win8 64位上运行时,就会报ReadCSE函数出错。
项目右键属性->项目设计器->生成->平台->把'默认设置(任何 CPU)'改为x86。
因为'任何 CPU'的程序在64位的机器上就会用运行为64位,而64程序是不能加载32位dll的
0 0
- VB.net程序System.BadImageFormatException: 试图加载格式不正确的程序
- System.BadImageFormatException: 试图加载格式不正确的程序
- System.BadImageFormatException: 试图加载格式不正确的程序。
- System.BadImageFormatException: 试图加载格式不正确的程序
- 试图加载格式不正确的程序 BadImageFormatException
- System.BadImageFormatException: 试图加载格式不正确的程序。 (异常来自 HRESULT:0x8007000B)v
- System.BadImageFormatException: 试图加载格式不正确的程序。 (异常来自 HRESULT:0x8007000B)
- WCF部署时的异常错误“System.BadImageFormatException: 未能加载文件或程序集“GCGL_Service”或它的某一个依赖项。试图加载格式不正确的程序。”
- System.BadImageFormatException: 未能加载文件或程序集“Oracle.DataAccess”或它的某一个依赖项。试图加载格式不正确的程序。
- 试图加载格式不正确的程序
- 试图加载格式不正确的程序
- 试图加载格式不正确的程序
- 试图加载格式不正确的程序
- IIS 试图加载格式不正确的程序的解决办法2
- 安装 Windows Service 试图加载格式不正确的程序
- C#调用DLL报“试图加载格式不正确的程序”
- C#调用DLL报“试图加载格式不正确的程序”
- asp.net 关于 试图加载格式不正确的程序 <add assembly="*"/>错误
- 毕业一年多了
- uva11107 - Life Forms 后缀数组
- java底层加载机制
- Java垃圾回收机制
- final关键字
- VB.net程序System.BadImageFormatException: 试图加载格式不正确的程序
- 判断Map的value值是否相等,相等则将key值组成字符串
- u-boot-2014.10移植第23天----nand flash启动(一)
- 运输层
- hibernate配置自动增长方式以及类别详解
- Sicily 3498 分解质因数 & 3496 鸡兔同笼
- iOS APP应用图标的相关问题
- 信号的处理
- 浦江镇漕河泾,爱登堡科技园,5A甲级写字楼,精装