Unhandled Exception: System.BadImageFormatException: Could not load file or assembly
来源:互联网 发布:java 潜艇发射导弹 编辑:程序博客网 时间:2024/05/18 00:29
.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.
需要翻译吗?简单来说,就是属性设置里应用平台不要选any cpu,改成x86,重新编译,OK。
转载自:点击打开链接
- Unhandled Exception: System.BadImageFormatException: Could not load file or assembly
- Unhandled Exception: System.IO.FileNotFoundException: Could not load file or assembly 'System.Enterp
- BadImageFormatException : Could not load file or assembly or one of its dependencies.
- Could not load file or assembly'System.EnterpriseServices'
- Could not load file or assembly 'System.ServiceModel.DomainServices.Hosting
- Could not load file or assembly 'System.Web.Extensions解决方案
- Could not load file or assembly 'System.Web.Helpers...错误
- could not load file or assembly "System.Web.Mvc...
- Could not load file or assembly ‘System.Configuration’
- Could not load file or assembly
- Could not load file or assembly...
- Exception about "Could not load file or assembly Namespace.Components' or one of its dependencies."
- Unhandled Exception: System.BadImageFormatException
- Could not load file or assembly "App_Licenses.dll" " Could not load file or assembly App_Web_"
- Could not load file or assembly'System.Data.SQLite.dll' or one of its depedencies
- Could not load file or assembly system.data.sqlite.dll or one for it's depedencies
- Exception from HRESULT: 0x800736B1,Could not load file or assembly 'Microsoft.SqlServer.BatchParser
- could not load file or assembly 'system.web.mvc version=1.0.0.0'
- hadoop运行python
- Swift集合类型(Collection Types)
- mongodb关于$set $unset的键增删操作
- 正确使用Block避免Cycle Retain和Crash
- CString 转换成 VARIANT
- Unhandled Exception: System.BadImageFormatException: Could not load file or assembly
- 黑马程序员——交通灯管理系统
- CSS
- java 架构师之路上的借鉴
- Effective C++第八条:避免析构函数中抛出的异常
- golang关于json库的一个比较容易陷入的坑 uint8[]数组的json转换问题.
- Android 相对布局属性
- Java 汉子转拼音
- ORCAD 中一次性修改元件属性