Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles / Visual-Studio

Visual Studio 2017 – Exception Helper (III)

4.00/5 (1 vote)
7 Jun 2017CPOL1 min read 6.9K  
Exception helper in Visual Studio 2017

Exception Settings has been a powerful feature in Visual Studio for quite some time now. It has got some extra fire-power with new Exception Helper dialog in Visual Studio 2017. Let’s say, your code is using a third party library that is throwing an exception. Let’s also say that this exception is of not much interest to you when it's raised by that third party library. Otherwise, you would like your debugger to break every time that same exception is thrown. Let me show how you can accomplish this with Visual Studio 2017.

Let’s say your solution has a dependency on a third party library for Video Streaming.

0

When using this library, it's throwing an exception that’s interfering with your debugging experience. In general, you would like your debugger to break on the exception, however, you don’t want the same behaviour when exception is thrown from this VideoStreaming library. With Visual Studio 2017, you can set a condition for this Exception to break except when it's thrown from VideoStreaming.dll as shown in the image below:

1

If this check-box for VideoStreaming.dll is checked, it will add a condition in the Exception Settings for this particular type of exception as shown below:

2

In case you decide to remove this setting, just right click on this condition will bring up the following context-menu.

3

Select “Edit Conditions” here, which will bring the following pop-up. This dialog provides you with the ability to either modify the condition or remove it entirely.

4

Until next time, happy debugging.

Filed under: CodeProject, Visual Studio 2017
Image 6 Image 7

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)