System.BadImageFormatException
2010-04-23 12:05
274 查看
http://connect.microsoft.com/VisualStudio/feedback/details/433065/system-badimageformatexception-is-not-informative
Posted by Microsoft on 5/19/2009 at 2:08 PM
Hello,
Thank you for getting in touch with us and providing this feedback. We are at a point in the release where this particular bug (BadImageFormatException should be more informative) does not meet the bug-fixing bar. As a result, I'm resolving your bug "By Design".
However, your suggestion is valid and here are some resources/mitigations that will help.
1) Run peverify.exe - this provides some useful information on the cause of the bad image, helping you to debug the issue better.
2) Check bitness - are you trying to load a 32 bit assembly in a 64 bit application?
3) Check if the runtime versions match - are you trying to load a CLR v2.0 assembly in an application that has CLR v1.1? Modules built against v2 can not be loaded by a pre-v2 CLR.
4) Are you loading an unmanaged assembly as if it's a managed dll?
(2), (3) and (4) are the primary causes of a BadImageFormatException. I hope this suggestion helps. If you think that the resolution of this bug is unacceptable, please feel free to send me an email at aarthir AT microsoft DOT com, or simply re-activate this issue.
Thanks!
Aarthi Ramamurthy,
PM, CLR.
Posted by Microsoft on 5/19/2009 at 2:08 PM
Hello,
Thank you for getting in touch with us and providing this feedback. We are at a point in the release where this particular bug (BadImageFormatException should be more informative) does not meet the bug-fixing bar. As a result, I'm resolving your bug "By Design".
However, your suggestion is valid and here are some resources/mitigations that will help.
1) Run peverify.exe - this provides some useful information on the cause of the bad image, helping you to debug the issue better.
2) Check bitness - are you trying to load a 32 bit assembly in a 64 bit application?
3) Check if the runtime versions match - are you trying to load a CLR v2.0 assembly in an application that has CLR v1.1? Modules built against v2 can not be loaded by a pre-v2 CLR.
4) Are you loading an unmanaged assembly as if it's a managed dll?
(2), (3) and (4) are the primary causes of a BadImageFormatException. I hope this suggestion helps. If you think that the resolution of this bug is unacceptable, please feel free to send me an email at aarthir AT microsoft DOT com, or simply re-activate this issue.
Thanks!
Aarthi Ramamurthy,
PM, CLR.
相关文章推荐
- asp.net mvc 调用C++编写的64位的dll引发System.BadImageFormatException
- C#调用VC dll 出现“System.BadImageFormatException”
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX
- System.BadImageFormatException: 试图加载格式不正确的程序。 (异常来自 HRESULT:0x8007000B)
- 关于异常的疑难解答:System.BadImageFormatException
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX或其某一依赖项
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX
- System.BadImageFormatException: 未能加载文件或程序集“Oracle.DataAccess”或它的某一个依赖项。试图加载格式不正确的程序。
- “System.BadImageFormatException”类型的未经处理的异常在 PurchaseDevices.Access.dll 中发生 其他信息: 未能加载文件或程序集“System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139”或它的某一个依赖项。试图加载格式不正确
- System.BadImageFormatException: 未能加载文件或程序集""或它的某一个依赖项。试图加载格式不正确的程序。
- System.BadImageFormatException
- BadImageFormatException: 无法加载引用程序集来执行,无法加载System.ComponentModel.EventBasedAsync
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX
- 异常:System.BadImageFormatException,未能加载正确的程序集XXX或其某一依赖项
- system.badimageformatexception 未能加载文件或程序集
- system.badimageformatexception 未能加载文件或程序集
- “System.BadImageFormatException”类型的未经处理的异常在 Castle.Windsor.dll 中发生 其他信息: 未能加载文件或程序集“Gis”或它的某一个依赖项。
- c#下出现“”未处理System.BadImageFormatException“错误
- System.BadImageFormatException: 试图加载格式不正确的程序。 (异常来自 HRESULT:0x8007000B) 在 YMS.FingerLogin.Form1.mxGetImage(Int32 iDeviceIndex, Byte[] imageBuf, Int64 nTimeOut, Int32 iFlagLeave)