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?
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.
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
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)
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.
精彩评论