BadImageFormatException : Could not load file or assembly or one of its dependencies.

/*By Jiangong SUN*/

If you have met this exception : Could not load file or assembly ‘{Library_Name}, Version=0.0.0.0, Culture=neutral, PublicKeyToken={Token}‘ or one of its dependencies. Tentative de chargement d’un programme de format incorrect.

It means the dll that you have referenced is not compatible with your project‘s build configuration likePlatform, or
Platform target.

If your the reference library is 32 bit, you need to make sure your platform and platform target is x86.

If your the reference library is 64 bit, you can configure the platform and platform target as Any CPU.

Once all these information are consistent, try to rebuild and rerun the project. :)

Enjoy coding!

reference:

http://stackoverflow.com/questions/11370344/could-not-load-file-or-assembly-an-attempt-was-made-to-load-a-program-with-a

时间: 2024-10-12 20:47:20

BadImageFormatException : Could not load file or assembly or one of its dependencies.的相关文章

System.BadImageFormatException: Could not load file or assembly

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>InstallUtil.exe C:\_PRODUKCIJA\Debug\DynamicHtmlTool.exeMicrosoft(R).NET FrameworkInstallation utility Version4.0.30319.1Copyright(c)MicrosoftCorporation.  All rights reserved.Exception occurred while i

Could not load file or assembly or one of its dependencies. 试图加载格式不正确的程序。

当我把编译好的程序托管到IIS下后,访问时出现了以下问题,服务器环境是IIS 7,操作系统 Windows server 2008 r2 64位. 出现上述问题的原因是,所加载的程序集中有32位的,也有64位的,IIS 7 程序池 在Windows下.Net FrameWork是64位的,要想正确使用,需要对程序池进行配置.如下图所示:

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. 试图加载格式不正确的程序. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about

[转] ASP.NET WEB API程序在VS启动或发布到IIS后启动后发生 - Could not load file or assembly 'System.Web.Http.WebHost’异常,无法正常访问

Just do Copy Local = true in the properties for the assembly(System.Web.Http.WebHost) and then do a redeploy, it should work fine. http://stackoverflow.com/questions/20323107/could-not-load-file-or-assembly-system-web-http-webhost-after-published-to-

Could not load file or assembly 'System.Core, Version=2.0.5.0 和autofac冲突的问题

在部署到iis的时候会出现这个状况.   这个软件(NDP40-KB2468871-v2-x64) 解决:下载安装这个补丁 http://support.microsoft.com/kb/2468871 http://www.microsoft.com/zh-cn/download/confirmation.aspx?id=3556 http://download.microsoft.com/download/2/B/F/2BF4D7D1-E781-4EE0-9E4F-FDD44A2F8934/

错误处理:"Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format."

情况:部署程序在 IIS 7.5 windows server 2008 R2 64 bit OS,引用“Oracle.DataAccess.dll” 运行程序会出现:"Could not load file or assembly 'Oracle.DataAccess' or one of its dependencies. An attempt was made to load a program with an incorrect format." 解决方式:设置IIS  app

[Nuget] - "Runtime error: Could not load file or assembly 'System.Web.WebPages.Razor, Version=3.0.0.0'" 问题之解决

环境 项目中使用了 System.Web.WebPages.Razor, Version=3.0.0.0,Nuget 还原缺失包后自动更新至 Version=3.2.5.0,编译成功,运行失败. 错误 "/"应用程序中的服务器错误.未能加载文件或程序集"System.Web.WebPages.Razor, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"或它的某一个依赖项.系统找不到

Svn启动窗口报错 Could not load file or assembly 'SharpSvn.dll' or one of its

win10 64位系统生成没问题,测试都没问题,结果换到win7 64位系统上,点开就出现,网上搜了下,通过以下方式解决, 必须把bin 文件夹全部删除,重新生成.要不还是会报错. Solve it. Change my platform to x86 Output path to "bin\" Downloaded the x86 of SharpSVN (1.7008.2243.14245) Add SharpSVN.dll in GAC. Delete the bin folde

CefSharp"Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies"

使用CefSharp时,在开发机没问题,在客户机出现“Could not load file or assembly 'CefSharp.Core.dll' or one of its dependencies"问题 但bin目录下又存在CefSharp.Core.dll文件,此问题是CefSharp是基于Vc++开发,因此必须要VC++运行时才能运行 解决办法:安装VC++ 2013 Redist或VC++ 2012 Redist(具体视CefSharp的版本) CefSharp"C