Why does VS2010 stop debugging when it catches certain exceptions instead of breaking?

So, I keep running System.InvalidOperationExceptionsomewhere in my code.

It is very difficult to debug.

At any time, attach the debugger via VS2010 and run my code, when it gets to System.InvalidOperationException, the debugger is automatically detached, not broken.

I even went into debugging settings and explicitly forbade breaking it.

I'm not sure if it automatically detaches when an exception is thrown, thereby defeating the goal of debugging in the first place - the function " I need to disable it.

Any help would be appreciated.

+3
source share
1 answer

The snapshot is in the dark, but check the debug setting "Only my code" and make sure it is disabled:

  • Debugging "Settings and Settings ..." uncheck the box "Include only my code (only managed)" "click" OK "

After disabling the JMC, try debugging again with exceptions with the first probability. From MSDN on random exceptions and JMC:

If you are debugging with Just My Code enabled, the behavior is a little different. When Just My Code is enabled, the debugger ignores common language (CLR) privilege exceptions that go beyond My Code and do not go through My Code. However, if the exception is not fully processed, the debugger always breaks.

, , JMC.

+1

Source: https://habr.com/ru/post/1774815/


All Articles