Saturday, 20 July 2013

Suppress JIT Debugging pop up screen Window When Unhandled Exception is Caught in Various Ways


















JIT Debugging :
       JIT Debugging is launches automatically when error or crash takes place in application which is runnning outside of  Visual Studio.

JIT debugging will popup a Window to select the debugging options when application crash takesplace.
Below is the sample pop up window




Now Let we see how we can suppress in various ways ,starts with the window based  application. Now how we can avoid the pop up window to launch when application crashes or error occurs.

Windows forms Application 
         Now our Window forms application is crashes outside the visual studio environment , Due to UnHandled Exception takes in Application. How we can avoid the pop up of this window.Add the following element in the app.exe.config file.
<configuration>
 <system.windows.forms  jitDebugging ="false" />
</configuration>
For C++ Application set the DebuggableAttribute in .Config file or in Code
[assembly:System::Diagnostics::DebuggableAttribute(false, false)]; 

To Enable or Disable JIT Debugging using visual studio
1.  In Visual Studio on the Tools Menu , Click Options.
2.  In the Options select Debugger.
3.  Select Just-In-Time 
4.  Enable Just-In-Time debugging of these types of code ,Select or De-Select the programs Managed, Native Or Script

To Disable JIT Debugging using Registry
1.  Click the Start Menu , select the Run dialog
2.  In the Registry Edit Delete the following Keys.

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\.NETFramework\DbgManagedDebugger

3.  If the system is 64 bit then delete the following keys also

HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\AeDebug\Debugger
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\.NETFramework\DbgManaged\DbgManagedDebugger
Some times Internet Explorer also do the pop up 
1.  Go to the Control Panel Menu , select the Internet options dialog
2.  Select the Advance 
3.  Check the "Disable the Script Debugging(Others)" and "Disable the Script Debugging(Internet Explorer)"