Visual Studio 2015 break on unhandled exceptions not working

Ted Lowery picture Ted Lowery · Jul 21, 2015 · Viewed 51.3k times · Source

Visual studio used to have a specific checkbox to "Break on Un-handled exception". In 2015 this has been removed (or moved somewhere I cannot find it). So now my converted projects no longer break if I fail to provide a user-level exception handler. I don't want to break on all "thrown exceptions" because I handle specific ones. Just where I fail to provide a specific handler.

Right now my code simply exits the current procedure and continues execution at the next call stack location, NOT GOOD.

Anyone know how to get this back in Visual Studio 2015? I just upgraded to the community edition yesterday.

Answer

Tom Studee picture Tom Studee · Jul 21, 2015

There's a new window called "Exception Settings" that appears in the lower right pane by default when you begin debugging. It has all of the options you would expect.

You can bring it up with CTRL+ALT+E

This allows you to cherry-pick which exceptions cause a break in the debugger.

The key, though, is that you can also set whether these exceptions always break, or only break when it's an unhandled exception -- but setting this is not very intuitive.

You will need to first check "Enable Just My Code" under Tools > Options > Debugging.

This then allows you to right-click the column header (Break When Thrown) in the new Exceptions Settings window, and add the "Additional Actions" column, which then allows you to set each exception as "Continue when unhandled in user code".

So just right-click an exception or an entire group and disable the "Continue when unhandled in user code" flag. Unfortunately, the "Additional Actions" column will show up empty which is the same as "Break when unhandled in user code".

enter image description here

More on this here:

http://blogs.msdn.com/b/visualstudioalm/archive/2015/02/23/the-new-exception-settings-window-in-visual-studio-2015.aspx