.NET Framework错误(HRESULT 0x8007000B) [英] .net Framework Error (HRESULT 0x8007000B)

查看:2707
本文介绍了.NET Framework错误(HRESULT 0x8007000B)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有写一个32位的Windows XP计算机上使用Visual Studio 2005中的C#应用​​程序的应用程序运行正常Windows XP计算机上,但是当我尝试在64位运行Windows 7专业版的机器,我得到以下对话框框上启动:





下面是从细节的全文。

 看到这个消息的结尾的详细信息,调用
刚刚在实时(JIT)调试而不是此对话框。

**************异常文本**************
System.BadImageFormatException:试图加载程序格式不正确。在ICSNeoCSharp.IcsNeoDll.icsneoTxMessages(的Int32 hObject,IcsSpyMessage&安培; PMSG,的Int32 lNetworkID,的Int32 lNumMessages)
在C
。在ICSNeoCSharp.FormDTCApplication.transmitFlowControl(的Int32 myArbID):(0x8007000B异常来自HRESULT):\文件和Settings\Administrator\Desktop\Adam东西ThinkPad\DTC检查FINAL\frmDTCApp.cs:行1750
在ICSNeoCSharp.FormDTCApplication.flowControlTimer_Tick(对象发件人,EventArgs e)在C:\Documents和Settings\Administrator\Desktop\Adam东西ThinkPad\DTC检查FINAL\frmDTCApp.cs:在System.Windows.Forms.Timer.OnTick(EventArgs五)
。在系统线5166
.Windows.Forms.Timer.TimerNativeWindow.WndProc(消息和M)
在System.Windows.Forms.NativeWindow.Callback(IntPtr的的HWND,味精的Int32,IntPtr的WPARAM,LPARAM的IntPtr)


**************加载的程序集**************
mscorlib程序
议会版本:2.0.0.0
Win32版本:2.0.50727.5472(Win7SP1GDR.050727-5400)
基本代码:文件:/// C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
- ---------------------------------------
DTC检查V1.0
集版本:1.0.4960.25549
Win32版本:1.0.4960.25549
基本代码:文件:/// C:/DTC%20Checker%20V1.0%20R3/DTC%20Checker%20V1.0% 20R3.exe
----------------------------------------
System.Windows.Forms的
议会版本:2.0.0.0
Win32版本:2.0.50727.5468(Win7SP1GDR.050727-5400)
基本代码:文件:/// C:/ Windows的/组装/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
------------------------- ---------------
系统
议会版本:2.0.0.0
Win32版本:2.0.50727.5467(Win7SP1GDR.050727-5400)
基本代码:文件:/// C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
------------------- ---------------------
System.Drawing中
议会版本:2.0.0.0
Win32版本:2.0.50727.5467(Win7SP1GDR .050727-5400)
基本代码:文件:/// C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
------- ---------------------------------
的Microsoft.Office.Interop.Excel
集版本:12.0.0.0
Win32版本:12.0.6600.1000
基本代码:文件:/// C:/Windows/assembly/GAC/Microsoft.Office.Interop.Excel/12.0.0.0__71e9bce111e9429c/Microsoft.Office .Interop.Excel.dll
----------------------------------------

************** JIT调试**************
要启用刚刚在时间( JIT)调试,对于这种
应用程序或计算机(Machine.config中的config文件)必须在System.Windows.Forms的部分设置
jitDebugging值。
中的应用程序,也必须与调试
编译启用。

为例:

<结构>
< System.Windows.Forms的jitDebugging =真/>
< /结构>

启用JIT调试后,任何未处理的异常
将被发送到计算机上的
注册,而不是由此对话框处理的JIT调试器。



有没有其他人遇到这个错误,并成功解决了吗?


< DIV CLASS =h2_lin>解决方案

当你的主应用程序可能会为值为anycpu建立你确定所有的组件都值为anycpu?你有带有原代码的任何原生组件或组件? ?他们是反对修建86



文件:/// C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll



这告诉我,该应用程序正在运行为x64的过程,但它似乎有一些汇编,是不是值为anycpu或x64这是有可能的BadImageFormatException的原因。



有一件事你可以尝试是运行在32位命令提示符(C:\windows\SysWow64\cmd.exe)应用程序强制它是一个32比特进程,看看是否能工程。如果这样的作品则肯定是有一些汇编,是不是值为anycpu。


I have a C# application which was written on a 32bit windows XP machine with Visual Studio 2005. The application runs fine on Windows XP machines, however when I try to run it on a 64bit Windows 7 professional machine, I get the following dialog-box on start up:

Here is the full text from the details.

  See the end of this message for details on invoking 
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.BadImageFormatException: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)
   at ICSNeoCSharp.IcsNeoDll.icsneoTxMessages(Int32 hObject, IcsSpyMessage& pMsg, Int32 lNetworkID, Int32 lNumMessages)
   at ICSNeoCSharp.FormDTCApplication.transmitFlowControl(Int32 myArbID) in C:\Documents and Settings\Administrator\Desktop\Adam Stuff ThinkPad\DTC Checker FINAL\frmDTCApp.cs:line 1750
   at ICSNeoCSharp.FormDTCApplication.flowControlTimer_Tick(Object sender, EventArgs e) in C:\Documents and Settings\Administrator\Desktop\Adam Stuff ThinkPad\DTC Checker FINAL\frmDTCApp.cs:line 5166
   at System.Windows.Forms.Timer.OnTick(EventArgs e)
   at System.Windows.Forms.Timer.TimerNativeWindow.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5472 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll
----------------------------------------
DTC Checker V1.0
    Assembly Version: 1.0.4960.25549
    Win32 Version: 1.0.4960.25549
    CodeBase: file:///C:/DTC%20Checker%20V1.0%20R3/DTC%20Checker%20V1.0%20R3.exe
----------------------------------------
System.Windows.Forms
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5468 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Drawing
    Assembly Version: 2.0.0.0
    Win32 Version: 2.0.50727.5467 (Win7SP1GDR.050727-5400)
    CodeBase: file:///C:/Windows/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
Microsoft.Office.Interop.Excel
    Assembly Version: 12.0.0.0
    Win32 Version: 12.0.6600.1000
    CodeBase: file:///C:/Windows/assembly/GAC/Microsoft.Office.Interop.Excel/12.0.0.0__71e9bce111e9429c/Microsoft.Office.Interop.Excel.dll
----------------------------------------

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
    <system.windows.forms jitDebugging="true" />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Has anyone else encountered this error and succeeded in solving it?

解决方案

While your main app might be built for AnyCPU are you sure all the assemblies are AnyCPU? Do you have any native assemblies or assemblies that contain native code? Are they built against x86?

file:///C:/Windows/Microsoft.NET/Framework64/v2.0.50727/mscorlib.dll

This tells me that the app is running as an x64 process but it would appear that there is some assembly that isn't AnyCPU or x64 which is likely the cause of the BadImageFormatException.

One thing you can try is to run the application from a 32-bit command prompt (c:\windows\SysWow64\cmd.exe) to force it to be a 32-bit process and see if that works. If that works then there is definitely some assembly that is not AnyCPU.

这篇关于.NET Framework错误(HRESULT 0x8007000B)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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