katit
katit

Reputation: 17915

How to force visual studio debugger to skip specific exceptions?

I have client-server (Silverlight) app.

Some server code throws exceptions that I handle on client. When I debug - Visual Studion breaks on those exceptions and I have to hit "Continue". It really slows down development.

Is there any way to skip specific exceptions or deal with this somehow?

Upvotes: 16

Views: 11519

Answers (4)

sll
sll

Reputation: 62504

See How to: Correct Run-Time Errors with the Exception Assistant

Basically you can disable checkbox "Enable the exception assistant" under the Visual Studio menu:

  -> Debug 
  -> Options and Settings 
  -> Debugging
  -> General

Also it could be that you've checked specific exception types to be handled so check it under the Visual Studio menu:

 -> Debug
 -> Exceptions

Upvotes: 3

Nivid Dholakia
Nivid Dholakia

Reputation: 5442

It happened to me once when i was debugging a code and it will show a Continue button and will never go inside the exception. The error that i was having is like i was creating and instances before the InitializeComponent() was called. I think this can help you to find what you are doing before that.

Upvotes: -2

Christopher Currens
Christopher Currens

Reputation: 30695

In visual studio, the Debug menu -> Exceptions. You can check and uncheck exceptions. You can have it break on handled thrown ones, or unhandled ones.

Also, if your exceptions are custom, they won't appear in there by default (only CLR exceptions are there). You can add them using the same window, be sure to use the fully qualified name for the exception (namespace and all)

Upvotes: 2

Ray
Ray

Reputation: 46585

Debug Menu -> Exceptions (Ctrl + Alt + E) -> Find.. type the exception name, then untick the check boxes.

If it's your own exception, you can add it by clicking Add, select Common Language Runtime Exceptions and then putting in the fully qualified name of the exception. Then untick the boxes.

Upvotes: 17

Related Questions