Posted by: Cirilo Meggiolaro | 04/10/2009

Tip of the day #178 – Setting how the exceptions are handled during debug

Visual Studio provides a way to handle how the debugger handles an exception. You may set this option for a single exception or group of exceptions.

How to…

To start press ctrl + D, E or click on menu Debug > Exceptions. The following dialog is displayed:

Picture 1 - The exception dialog

Picture 1 - The exception dialog

You may have noticed a tree view control with several exception categories and two checkboxes that you may choose between Thrown and User-unhandled. Expanding each category on the tree view you will see the exceptions in details.

Thrown

If you check the Thrown checkbox the debugger will break when an exception for that specific type happens so you will be able to view it even if the code is “bypassing” the exception.

User-handled

The checkbox for user-handled will make the debugger to ignore the exception if only this option is checked. It’s up to you to catch it or break.

Display problem

If you are not able to view the user-handled column go to menu Tools > Options > Debugging and check the option Enable Just My Code (managed only).

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Categories

%d bloggers like this: