图片格式问题 [英] bad image format problem

查看:141
本文介绍了图片格式问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我开发了Web应用程序(.Net 4.0).在x-64位OS上,它可以在本地计算机上正常工作,但是当我在VPS(主机)上运行它时却显示问题,异常是-" System.BadImageFormatException:无法加载文件或程序集''WebApplication "或其依赖项之一.尝试加载格式错误的程序".

为了解决该问题,我将应用程序64更改为86,但仍然面临着同样的问题,有人可以帮助我.

我该如何解决该问题.

Hi,

I developed web application (.Net 4.0). On x-64 bit OS it was working with local machine fine but it was showing problem when I was running it with VPS(host machine) the exception was - "System.BadImageFormatException: Could not load file or assembly ''WebApplication'' or one of its dependencies. An attempt was made to load a program with an incorrect format".

To remove that problem I changed my application 64 to 86 but still I am facing same problem can somebody help me.

How can I resolve that problem.

推荐答案

如果您的DLL与调用EXE的32位字符不匹配,您将得到一个错误的图像格式异常. /64位格式,或者您尝试从.net2 EXE运行.net4 DLL.

如果使用混淆器(会破坏PE格式),也会出现这些错误.

尝试检查您的Web主机使用的是.net4而不是.net2.
You will get a bad image format exception if your DLL''s don''t match the calling EXE''s 32/64 bit format or you are trying to run a .net4 DLL from a .net2 EXE.

You will also get these errors if you have used an obfuscator (which mangles the PE format).

Try checking your web host is using .net4 and not .net2.


通常在动态链接库(DLL)或可执行程序的文件映像无效时引发此异常.

BadImageFormatException的原因 [ 从给定的链接中读取线程
http://support.leadtools.com/CS/forums/32979/ShowPost.aspx [ ^ ]
This exception is generally thrown when the file image of a dynamic link library (DLL) or an executable program is invalid.

Cause of BadImageFormatException[^]
This may occur on a 64 bit machine running .net 2.0. DotImage assemblies have unmanaged code in them, so they always need to be run in the 32 bit runtime. "BadImageFormat" is referring to the format of the dll, it means .net tried to load a 32bit only assembly into the 64 bit runtime.

Read the thread from given link
http://support.leadtools.com/CS/forums/32979/ShowPost.aspx[^]


这篇关于图片格式问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆