[英]Visual Studio break on Program.cs not on the line that throws the exception
I have a C# console application.我有一个 C# 控制台应用程序。 In
Program.cs
, I make calls to a variety of services.在
Program.cs
中,我调用各种服务。 If one of those services throws an Exception
, VS breaks in Program.cs
and not on the line that is actually responsible for the error.如果其中一项服务引发
Exception
,则 VS 在Program.cs
中中断,而不是在实际负责该错误的行上。 The modal doesn't even indicate which line threw.模态甚至不指示哪条线抛出。 I understand that you can still get the trace etc., but usually VS breaks on the responsible line which makes debugging far easier.
我知道您仍然可以获得跟踪等,但通常 VS 在负责的线路上中断,这使得调试更加容易。
How can I get VS to break on the "external code"?如何让 VS 打破“外部代码”?
Open Exception Settings from Debug > Windows > Exception Settings从 Debug > Windows > Exception Settings 打开异常设置
Search your exception name.搜索您的异常名称。
Check the checkbox before your exception.在您的异常之前选中复选框。
Uncheck Enable Just My Code in Debug > Options > Debugging > General在 Debug > Options > Debugging > General 中取消选中Enable Just My Code
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.