Export (0) Print
Expand All

How to: Debug a Just-In-Time Exception

This topic applies to:

Visual Studio Edition

Visual Basic

C#

C++

J#

Express

No

No

No

No

Standard

Yes

Yes

Yes

Yes

Pro/Team

Yes

Yes

Yes

Yes

If you have enabled Just-In-Time debugging, you can test your program outside of Visual Studio and still use the Visual Studio debugger when a crash or exception occurs.

When a crash occurs with Just-In-Time Debugging enabled, a dialog box appears with a message like this:

An unhandled exception ('System.TypeInitializationException') occurred in terrarium.exe[3384]

The following procedure describes what to do when you receive this error.

To debug a Just-In-Time exception

  1. On the Possible Debuggers list, click New instance of Visual Studio 2005.

    If another instance of Visual Studio 2005 is already running, you can choose that instance instead.

  2. If you want to use Visual Studio 2005 automatically for all future crashes, click Set the currently selected debugger as the default.

    -Or-

    If you want to choose what types of code you will be able to debug, click Manually choose the debugging engines. If you do not choose this option, Visual Studio will automatically select the debug engines appropriate for the type of code in your program.

  3. Click OK.

    If your assembly contains untrusted code, a security warning dialog box will appear, giving you the option to continue debugging or not.

  4. Decide whether you trust the code— perhaps because you wrote it or trust the author—or not—perhaps it is running on a remote machine and you do not recognize the name of the process. Just because the code is running locally, that is not a sufficient reason to trust it: if you are running Internet Explorer, malicious ActiveX code could be running. Consider any such controls that may be running in applications on your machine. If you trust the code click Debug, if not, click Don't Debug.

See Also

Community Additions

ADD
Show:
© 2014 Microsoft