简体   繁体   English

Visual Studio不会破坏ASP.NET中用户处理的异常

[英]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 can turn off the check Break when this exception type is thrown . 抛出此异常类型时,我可以关闭check break 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. 不想这样做,因为我不希望在我没有一个try / catch所有其他情况下打破。
  • I can turn Except when thrown from this dll . 从这个dll抛出时我可以转向Except 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. 这个DLL中有正当理由,为什么我想在我自己不尝试/捕获它时打破它。

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 . 仅在外部代码中尝试/捕获。

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. 但这并不意味着它不存在。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Visual Studio 11中ASP.NET项目的安全性例外 - Security Exception with ASP.NET project in Visual Studio 11 “例外”对话框中用户处理的列发生了什么变化? - What happened to the User-handled column in the Exceptions dialog? Visual Studio中断了已处理的异常 - visual studio breaks on handled exception ASP.NET MVC 4 System.Data.dll 中发生“System.Data.SqlClient.SqlException”类型的异常,但未在用户代码中处理 - ASP.NET MVC 4 An exception of type 'System.Data.SqlClient.SqlException' occurred in System.Data.dll but was not handled in user code ASP.NET WebAPI错误:EntityFramework.dll中发生类型为'System.Data.SqlClient.SqlException'的异常,但未在用户代码中处理 - ASP.NET WebAPI error: an exception of type 'System.Data.SqlClient.SqlException' occurred in EntityFramework.dll but was not handled in user code 在ASP.NET MVC中的Visual Studio 2013中调用“全部中断”时,是否可以隐藏“源不可用”选项卡? - Is there a way to hide the “Source Not Available” tab when invoking “Break All” in Visual Studio 2013 in ASP.NET MVC? Visual Studio-独立的Asp.net项目 - Visual studio - Separate asp.net projects 为什么Visual Studio会中断第三方库中引发和处理的异常? - Why does Visual Studio break on Exceptions thrown and handled in a third party library? Visual Studio Visual Studio MVC asp.NET Google Map - Visual Studio Visual Studio MVC asp.NET Google Map Visual Studio 在已处理的异常上中断,就好像它是未处理的一样 - Visual Studio breaks on Handled Exception as if it was Unhandled
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM