[英]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. 每当我在自己的代码中有一个try / catch语句时,异常仍然会破坏调试器。
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. 我只是想在没有 try / catch语句的情况下不打破 ,因为我已经在处理它,所以我不想被每个失败的外部调用窃听。
How can I do this? 我怎样才能做到这一点?
UPDATE UPDATE
This mainly seems to be a problem with ASP.NET. 这主要是ASP.NET的一个问题。 Probably because there is one big try/catch per request in the outermost ASP.NET layer. 可能是因为在最外层的ASP.NET层中每个请求有一个大的try / catch。
So what I'm looking for in a way is something like: 所以我在某种程度上寻找的是:
Break only try/catched in external code . 仅在外部代码中尝试/捕获。
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. 但这并不意味着它不存在。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.