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

Time:09-23

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"?

enter image description here

CodePudding user response:

  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

  • Related