0

I use visual studio 2017 And in Exception settings common language runtime exceptions is checked

[System.Diagnostics.DebuggerNonUserCode]
[System.Diagnostics.DebuggerHidden()]
public static void testFunc()
{
    try
    {
        throw new Exception();
    }
    catch {}
}

the Debuger stop on testFunc(); and show exeption

there is why to ignore specific function in the code?

Not in GUI settings (the debugger does not break to other programmers)

In other words how to uncheck that in the code

enter image description here

Raful Chizkiyahu
  • 364
  • 2
  • 15
  • The docs say _"The common language runtime attaches no semantics to this attribute. It is provided for use by source code debuggers. For example, the Visual Studio debugger does not stop in a method marked with this attribute and does not allow a breakpoint to be set in the method."_ - why do you think exceptions thrown in this method would be handled differently? – stuartd Dec 05 '19 at 12:13
  • [exemple code](https://stackoverflow.com/a/1374644/10899908) – Raful Chizkiyahu Dec 05 '19 at 12:27
  • I don't really see the relevance of that link. If you've checked "break on all exceptions" in the Exception Settings, then all the exceptions are "checked", and as the [docs](https://learn.microsoft.com/en-us/visualstudio/debugger/managing-exceptions-with-the-debugger?view=vs-2019#tell-the-debugger-to-break-when-an-exception-is-thrown) say _"If you select an exception in the Exception Settings window, debugger execution will break wherever the exception is thrown, **no matter whether it's handled**. Now the exception is called a first chance exception"_ – stuartd Dec 05 '19 at 14:43

0 Answers0