简体   繁体   中英

Visual Studio break on Program.cs not on the line that throws the exception

I have a C# console application. In Program.cs , I make calls to a variety of services. 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. 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.

How can I get VS to break on the "external code"?

在此处输入图像描述

  1. Open Exception Settings from Debug > Windows > Exception Settings

  2. Search your exception name.

  3. Check the checkbox before your exception.

  4. Uncheck Enable Just My Code in Debug > Options > Debugging > General

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