Fabrice's weblog

Tools and Source

News

My .NET Toolbox
An error occured. See the script errors signaled by your web browser.
No tools selected yet
.NET tools by SharpToolbox.com

Read sample chapters or buy LINQ in Action now!
Our LINQ book is also available on AMAZON

.NET jobs

Emplois .NET

Tuneo

ASP.NET Hosting transatlantys

Contact

Me

Others

Selected content

Archives

How to turn off/disable the .NET JIT Debugging Dialog

Just quoting Scott Hanselman for this tip:

A day may come when you want to turn off the Debug dialog that appears when a .NET program has an unhandled exception.

Option 1: Registry key from Enabling JIT Debugging

For an application that includes managed code, the common language runtime will present a similar dialog to JIT-attach a debugger. The registry key that controls this option is called HKEY_LOCAL_MACHINE\Software\Microsoft\.NETFramework\DbgJITDebugLaunchSetting.

  • If value = 0, prompt the user by means of a message box. The choices are:
    • Continue. This results in a stack dump and process termination.
    • Attach a debugger. In this case, the runtime spawns the debugger listed in the DbgManagedDebugger registry key. If none, control is returned, and the process is terminated.
  • If value = 1, simply return control. This results in a stack dump, after which the process is terminated.  (No more dialog)
  • If value = 2, spawn the debugger listed in the DbgManagedDebugger registry key.

Option 2: If you want to disable the JIT debug dialog, but still want an error dialog:

Visual Studio.NET|Tools|Options|Debugging|Just-In-Time and deselect "Common Language Runtime" and now you’ll get an OK/Cancel dialog instead of the select a Debugger Dialog.  Note: The registry entry from Option 1 above will need to be 0 for the dialog to show up.

Thanks to Eric Deslauriers of Corillian QA for these tips!


This dialog can be useful in some cases (mainly in development), but annoying in most cases. But, what if I want to disable this dialog per application?

Comments

Winston E said:

So far so good for the technically inclined. What about the guy who is not? How can I get my application to work without getting this message fouling up my life?
# October 9, 2006 3:17 PM

Fabrice said:

Message from Qasemt AT gmail.com: See http://msdn2.microsoft.com/en-us/library/k8kf6y2a.aspx

# November 20, 2006 8:58 AM

Clark Kemp said:

I have read all the applications you have provided and aplied the registry key solution, but still have not succeeded in eliminating the problem dialogue box. What do you suggest?

# January 20, 2007 12:35 AM

Dave Egeland said:

I know nothing of programming and such. That nagging JIT Debug screen comes-up every time I start-up. I know it must have been some dumb thing I did while tinkering with settings one day. But, how do I get rid of that EASILY without having to be a professional programmer???? PLEASE HELP!!!!

# January 26, 2007 3:11 PM

Lakario said:

I'm pretty sure being a professional programmer isn't going to make a difference. :)

# March 11, 2007 9:50 PM

Kirk said:

I have that damn same problem on Start Up. How do I get rid of it??

# April 15, 2007 6:27 PM

Simon said:

Same damn problem.

No idea how to get rid of it

# July 7, 2007 11:54 PM

roberta cox said:

Same problem for me too.

# July 31, 2007 7:58 PM

psb said:

I get the same thing, but also windows installer springs into life and tries to install "photo gallery".

investigating.

# August 22, 2007 4:49 AM

psb said:

just as I thought, the two problems were connected,

by loading and running msicuu2.exe from:

support.microsoft.com/.../290301

I found the culprit an old photo prog that has been forgotten. this little prog allows you to delete anything installed by windows installer, it cured my problem, but first you have to isolate which program is causing the trouble, I was lucky!.

# August 22, 2007 1:40 PM

Greg said:

much easier than that.  Open Microsoft Word.  Go to tools|macro|microsoft script editor.  in script editor, go to tools|options|debugging.  click "JIT Settings". Clear the checkbox for "JIT DEbugging"

# August 27, 2007 2:49 AM

Doug in Uganda said:

Greg. Thank you for the simple solution (assuming it won't cause problems later).

# September 19, 2007 4:59 AM

Milton said:

I am not sure but my rpoblem could be similar to one above: I get the following on my machine:

"Unhandled exception has occured in your application. If you click continue the application will ignore this error and attempt to continue. If you click quit the application will close immediately."

The third button besides Continue and Quit is Detail.  On pressing this button and it gives info on “ JIT Debugging” of application. Have you ever come across a problem like this and how do we solve it.

# November 5, 2007 3:23 PM

neilcris said:

I got the same problem. And I want to try in Word. But I find difficulty in locating the Options on Word 2007. Can anyone advise me where to locate tools|macro|microsoft script editor?

# November 6, 2007 9:12 PM

puz said:

MSE

Description: (In word 2007) Microsoft Script Editor (MSE) is removed. Documents that contain scripts and that are upgraded to the new file formats lose the scripts without warning.

Reason for change: The removal of this low-use feature increases security.

technet2.microsoft.com/.../e55b85c1-213f-47d5-809c-aba9331ae0331041.mspx

# November 11, 2007 3:41 AM

A Dev’s Life » Blog Archive » Just-in-time Debugging??????????????????????????????????????? said:

Pingback from  A Dev’s Life  » Blog Archive   » Just-in-time Debugging???????????????????????????????????????

# November 23, 2007 3:15 AM

Sergioalcala@hotmail.com said:

I'm trying to download something but every time i try that Jit stuff keeps coming up and i have no idea how to get to it and turn it off can any one help?please E-mail me at Sergioalcala@hotmail.com  0r Secks4rmlwd@yahoo.com

Thanks...=]

# December 12, 2007 8:35 PM

Joyce Phelps said:

I have the same problem with the photo gallery install business and the JIT.  I'm about to start using a typewriter again.  I need help but am not a programmer, only a user.  I don't have Microsoft Word on my computer so the solutions I have read about are impossible for me.  I am using my husband's computer since he passed away.  He was an IT man and usually could solve any problem I had.  I'm totally out of my depth with a problem like this.  If anyone can help with a simple (not too technical) solution,I will be eternally grateful.

Joyce

# December 19, 2007 6:23 PM

anonymous said:

# If value = 0, prompt the user by means of a message box. The choices are:

   * Continue. This results in a stack dump and process termination.

   * Attach a debugger. In this case, the runtime spawns the debugger listed in the DbgManagedDebugger registry key. If none, control is returned, and the process is terminated.

thats the one i have.... i need help :(

# January 7, 2008 7:05 PM

Jackie Shellmer said:

I'm not sure how this occured but I am challenged technologically and have no idea how to get rid of this dialog.  HELP!!!

# January 28, 2008 2:50 PM

JON said:

much easier than that.  Open Microsoft Word.  Go to tools|macro|microsoft script editor.  in script editor, go to tools|options|debugging.  click "JIT Settings". Clear the checkbox for "JIT DEbugging"

I WAS DOING GREAT TILL THE "DEBUGGING" PART OF THE INSTRUCTIONS. THAT CHOICE WASNT AVAILABLE. WHAT NEXT?

I WAS IN OFFICE WORD 2003.

# January 29, 2008 9:03 PM

Kim said:

I had the same problem Jon.  I tried to do the same thing, but found the debuggging section wasn't there.  I'm also using Office Word 2003.

My error only occurs when I try to copy something out of a document using an adobe viewer. I don't know why it won't transpose across into Word. :(

# January 31, 2008 12:34 AM

MIKE said:

Had the exact same problem as psb.  Just wondering if anyone knows what photo program could be causing the problem, or how to go about finding what program is causing the problem.

# March 17, 2008 12:27 PM

SAD said:

Maybe you need to reinstall .netframework with optional settings

# June 16, 2008 5:41 AM