Unhandled Exception: System.BadImageFormatException: Could not load file or assembly (2008R2配置x64website)
.NET Error Message: Unhandled Exception: System.BadImageFormatException: Could not load file or assembly 'ChilkatDotNet2, Version=7.7.5.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd' or one of its dependencies. An attempt was made to load a program with an incorrect format. File name: 'ChilkatDotNet2, Version=7.7.5.0, Culture=neutral, PublicKeyToken=eb5fc1fc52ef09bd' at MailBounce.Program.Main(String[] args)
Solution:Your program is trying to use a DLL targeted for win32 on an x64 platform, or the reverse: you have an x64 DLL and are trying to run it on a win32 computer.
C# dll is built for 'Any CPU' platform by default. On 64 bit machine 'Any CPU' maps to 64 bit platform. Now when I run such a C# project which has been built for 'Any CPU' platform and refers a 32bit dll, BadImageFormatException is thrown because loader tries to load a 32 bit dll in 64 bit process address apace which is obviously going to fail.
so you either need to run it in a 32-bit OS or you have to make your application run inside WoW64. To force the app to run in WoW64 you can go to the project properties in VS, select the "build" tab, and set the "platform target" to x86.
//-------------------------------总结-------------------------
2008R2 website站点类型配置为 anycpu or x64
IIS7.5站点应用程序池 -〉高级设置-〉更改启用32位应用程序兼容,不建议使用
辨识64 or 32位运行通过任务管理器,w3wp.exe 后没有*32说明程序运行在64位池下,尽情享受高性能...
Unhandled Exception: System.BadImageFormatException: Could not load file or assembly (2008R2配置x64website)的更多相关文章
- System.BadImageFormatException: Could not load file or assembly
C:\Windows\Microsoft.NET\Framework64\v4.0.30319>InstallUtil.exe C:\_PRODUKCIJA\Debug\DynamicHtmlT ...
- Unhandled Exception:System.DllNotFoundException: Unable to load DLL"**":找不到指定的模块
在项目中使用C#代码调用C++ DLL时.常常会出现这个问题:在开发者自己的电脑上运行没有问题,但是部署到客户电脑上时会出现下面问题: Unhandled Exception:System.DllNo ...
- iis配置问题报错 -- Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies
具体提示: Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. 试图加载格式不正确的程序. ...
- [转]Could not load file or assembly 'System.Core, Version=2.0.5.0 和autofac冲突的问题
Could not load file or assembly 'System.Core, Version=2.0.5.0 和autofac冲突的问题 来源:http://www.cnblogs.co ...
- Could not load file or assembly 'System.Core, Version=2.0.5.0 和autofac冲突的问题
在部署到iis的时候会出现这个状况. 解决:下载安装这个补丁 http://support.microsoft.com/kb/2468871 http://www.microsoft.com/zh-c ...
- Could not load file or assembly (Exception from HRESULT: 0x80131047)-解决办法
场景:.Net 4.0 MVC WebAPI 应用程序添加ApplicationInsights监控后在demo环境运行正常,发布到testing环境出现异常 异常信息: Could not load ...
- Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The located assembly's manifest definition does not mat
Could not load file or assembly 'System.Net.Http, Version=4.2.0.0, Culture=neutral, PublicKeyToken=b ...
- Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting'.系统找不到指定文件
项目部署到服务器后出现如下错误信息: Parser Error Message: Could not load file or assembly 'System.ServiceModel.Domain ...
- Could not load file or assembly 'System.Data.SQLite' or one of its dependencies
试图加载格式不正确的程 异常类型 异常消息Could not load file or assembly 'System.Data.SQLite' or one of its dependencies ...
随机推荐
- java go
熟练掌握java技术,对多线程.数据结构有清晰的认识: 熟悉MySQL/Oracle数据库,熟悉关系数据库应用设计开发: 熟悉Spring/MyBatis/Freemarker等一种或者多种框架: j ...
- Java日期和时间
目录 Java 日期和时间 Java 日期和时间 学习自 http://blog.csdn.net/zjf280441589/article/details/50447533 Date类 Date 类 ...
- 添加第一个控制器(Controllers)
在MVC体系架构中,输入请求是由控制器Controller来处理的(负责处理浏览器请求,并作出响应).在ASP.NET MVC中Controller本身是一个类(Class)通常继承于System.W ...
- JAVA poi 帮助类
pom.xml 添加引用: <!--poi--> <dependency> <groupId>org.apache.poi</groupId> < ...
- 【转载】GetDeviceCaps()函数相关说明
CDC::GetDeviceCaps()物理长度与屏幕像素间的转换 作用:读取DC的一些打印区域信息,主要是像素和英寸方面的数据. 声明:GetDeviceCaps(int ) 使用例子://所有像素 ...
- j.u.c系列(11)---之并发工具类:Exchanger
写在前面 前面三篇博客分别介绍了CyclicBarrier.CountDownLatch.Semaphore,现在介绍并发工具类中的最后一个Exchange.Exchange是最简单的也是最复杂的,简 ...
- CentOS下KVM网卡设置成网桥时获取镜像端口的流量
首先,网桥配置好之后就能实现一个简单的交换机,而交换机的特点就是MAC地址学习,那么KVM的网卡设置成网桥之后,也就是相当于连接到了交换机上. 此时如果要实现在二层交换机或三层交换机做端口镜像,并把这 ...
- Spring 注解学习手札(七) 补遗——@ResponseBody,@RequestBody,@PathVariable(转)
最近需要做些接口服务,服务协议定为JSON,为了整合在Spring中,一开始确实费了很大的劲,经朋友提醒才发现,SpringMVC已经强悍到如此地步,佩服! 相关参考: Spring 注解学习手札(一 ...
- securecrt中文乱码以及ubuntu设置locale
参考文献 http://wiki.ubuntu.org.cn/%E4%BF%AE%E6%94%B9locale http://www.bootf.com/547.html 强烈建议 ubuntu下面不 ...
- EF6+Sqlite连接字符串的动态设置
摘要 在winform中应用sqlite和ef,对于sqlite连接字串的设置,大多情况下是不想写死了,你不知道用户会将你的exe程序安装在什么位置,也不知道他的电脑盘符是什么,如果写死了,那么很有可 ...