Just-In-Time Debugging
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

Just-In-Time Debugging

You can run a program created in Visual Studio outside of the Visual Studio environment. Just-In-Time debugging is a technique for debugging a program that is started outside of Visual Studio. If you have enabled Just-In-Time debugging, the program will bring up a dialog box when a crash occurs. This dialog box will ask if you want to debug the program and which debugger you want to use.

Note   For applications written with Managed Extensions for C++, if you are debugging a nonoptimized release build, Just-in-Time debugging might break at a different location from where exception was actually thrown. To correct this, add the following code to your application's AssemblyInfo.cpp file:
[assembly:System::Diagnostics::DebuggableAttribute(true, true)];
If you compile with /Zi and without /Og, the compiler sets this attribute for you.
For more information, see DebuggableAttribute Constructor.

See Also

Using the Debugger | Just-In-Time, Debugging, Options Dialog Box

© 2016 Microsoft