To enable just-in-time (JIT) debugging错误的解决方式

来源:互联网 发布:java file.getlength 编辑:程序博客网 时间:2024/06/12 00:08

       写了个Windows桌面程序报错,具体错误信息大致如下:

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

……

************** 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.

       大意是在.NET环境运行下,出现了不可预见的错误,然而这种错误可能并不会影响程序的正常运行,他会给你弹出一个提示框。

解决方式:

1.添加一个应用程序配置文件 <application name>.exe.config,指定程序运行时,jitDebugging的值为true。记住不要设为false,看到有楼主设成false,真是一刀切的拿来主义,还是要自己再调试看看,避免误人子弟。其实,这种方式在错误详情里面已经提示了,该配置文件内容如下:

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


2.如果是C++程序的话,你还必须设置DebuggableAttribute特性在.config文件中,或者在代码中设置:

[assembly:System::Diagnostics::DebuggableAttribute(true, true)]; 

3.当然,以上两种方式还是不行的话,可以通过修改注册表来实现:

在“开始”菜单中,输入regedit.exe查找并打开注册表

在注册表项编辑器窗口中,查找并删除下列注册表项

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger

  • HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger

如果您的计算机正在运行64位操作系统,请删除以下注册表项

  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger

  • HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger

注意不要意外删除或更改其他注册表键,最后关闭注册表编辑器窗口。


参考官方链接:

https://msdn.microsoft.com/en-us/library/bdcetka3(v=vs.71).aspx

https://msdn.microsoft.com/en-us/library/5hs4b7a6.aspx

阅读全文
0 0
原创粉丝点击