.net程序排除不可预见的错误就会抛出上述错误,但是有时候上述错误不一定影响程序的正常运行,但是给用户看到这样的东西是不太好的,因此需要将其disable
方法如下
方法一:
To disable Just-In-Time debugging of a Windows Form
-
Set the jitDebugging value in the machine.config or application.exe.config file, located in thesystem.windows.forms section totrue. For example:
-
In addition, Windows Forms created by using C++ must have the DebuggableAttribute set in a .config file or within their code. If you compile with/Zi and without/Og, the compiler sets this attribute for you. If you want to debug a non-optimized release build, however, you must set this yourself by adding the following line to your application's AssemblyInfo.cpp file:
For more information, see DebuggableAttribute.
方法二:
To disable Just-In-Time debugging by editing the registry
-
In the Start menu, click Run.
-
In the Run dialog box, type regedit, then clickOK.
-
In the Registry Editor window, locate and delete the follow registry keys:
-
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
-
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger
-
-
If your computer is running a 64-bit operating system, delete the following registry keys also:
-
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
-
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManagedDebugger
-
-
Take care not to accidentally delete or change any other registry keys.
-
Close the Registy Editor window.