简体   繁体   中英

Visual studio does not break on user-handled exception in ASP.NET

Whenever I have a try/catch statement in my own code, the Exception still breaks to debugger.

  • I can turn off the check Break when this exception type is thrown . I don't want to do that because I do want to break in all other cases that I don't have a try/catch.
  • I can turn Except when thrown from this dll . I don't want to that for the exact same reason. There are valid reasons in that DLL why I want to break when I do not try/catch it myself.

I just want to not break when I have a try/catch statement, because I am already handling it so I don't want to be bugged by every external call that is failing.

How can I do this?

UPDATE

This mainly seems to be a problem with ASP.NET. Probably because there is one big try/catch per request in the outermost ASP.NET layer.

So what I'm looking for in a way is something like:

Break only try/catched in external code .

Visual Studio调试器

Maybe I don't understand your question but if you just take out "Break when this exception type is thrown" you should have the exact behaviour you want. The debugger will still break if the exception isn't caught. The only thing this checkbox does is tell the debugger to break even if the exception got caught .

If this is not the behaviour you want I may need some clarification to understand your question.

Edit:
Since you've now edited your question and you seem to be looking for "Break only try/catched in external code.", I can only tell you that I wouldn't know of such a feature and have never used anything like that. That does not mean it doesn't exist though.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM