Using the New Exception Helper in Visual Studio “15” Preview

Dealing with exceptions is a common developer problem no matter your technology or level of expertise. It can be a frustrating experience figuring out why exceptions are causing problems in your code. When you are debugging an exception in Visual Studio, we want to lessen that frustration by providing you with relevant exception information to help you debug your issue faster. So in Visual Studio “15” Preview we are introducing the simplified, non-modal, new Exception Helper.

ExceptionHelperPreview1

help2

In previous versions of Visual Studio, when you break on an exception, you will see the Exception Assistant (when debugging managed code), or the Exception Dialog (when debugging Native code, or if you disabled the Exception Assistant).

Exception Assistant:

help3

Exception Dialog:

help4

We looked closely at both of these dialogs, listened to your feedback on User Voice and from Send-A-Smile, and decided they needed an overhaul. The most frequent complaints were about the modal dialog when debugging native, large size of the dialogs, and a lack of immediate access to important exception information, (e.g. inner exceptions).

The goal is to provide you with the information you care about at the line of code where it is relevant for both native and managed debugging.

The Highlights

Let’s take a look at some of the benefits of the new Exception Helper.

  • Breaking on the Line of Code – No matter if you are managed or native debugging, when you break on an exception the debugger will stop you on the line of code where that exception happens. An exception error icon will appear to the right of that line of code and the non-modal, smaller, less distracting Exception helper will pop down from that icon and stay pinned to that code line.
  • Exception Information at a Glance – You will instantly be able to read the exception type and exception message in the Exception Helper, and whether the exception was thrown or unhandled. You will also see any analysis information we know, for example what expression in your C++ application caused an Access Violation.

DividebyZeroException

  • Inner Exceptions right away – No longer will you have to drill into the exception details to see if there is an inner exception. We show it to you right when you break with the ability to navigate back through multiple inner exceptions.

InnerException

  • Move it where you need it – You can drag the Exception Helper from its pinned view to its floating view if it happens to cover up something you need to look at, or you want to view it while switching code files. You can also use the pin icon to float it, or snap it back to the line of code. If you close the Exception Helper, simply click on the exception error indicator to bring it back up.

help8

  • Faster breaking for Unhandled Exceptions – When managed debugging, the debugger will no longer automatically unwind the Call Stack when you break on an unhandled exception. This means that you will break into your code faster because the debugger doesn’t need to walk the Call Stack before breaking.
  • Configure your Exception Settings – When you break on a Thrown Exception you can use the checkbox under Exception Settings in the Exception Helper to disable breaking on that exception when through in the future.

ExceptionThrown

  • Non-Modal – When native debugging, you will no longer need to dismiss an exception dialog to inspect your code. The new Exception Helper is available right inline next to your code.

 

If you need to turn off the Exception Helper go to Debug->Options, scroll to the bottom of the list and un-check the box for “Use the new Exception Helper”. Then use the report a problem feature of Visual Studio to let us know why the Exception Helper wasn’t working for you.

Wrap Up

We encourage you to download Visual Studio “15” Preview today and use the new Exception Helper, and send feedback about the experience. We hope you find this it useful and let us know if you have any questions in the comments section below, using the Send Feedback feature in Visual Studio, or via Twitter.

Sign up to help us improve the Visual Studio Debugger: aka.ms/debuggerfb