Why doesn't Visual Studio break on exceptions when debugging unit tests?

后端 未结 8 717
深忆病人
深忆病人 2020-12-29 02:53

When I attempt to debug a unit test that fails because of an unhandled exception in my code, I expect Visual Studio to break on the unhandled exception so I can inspect the

8条回答
  •  攒了一身酷
    2020-12-29 03:23

    I found a solution that works for me in a similar scenario.

    If you notice that the debugger output is throwing handled exceptions you can note those exceptions.

    Example

    Take the ones you've just noted and open up the Exception Settings

    Alternatively you can hit Ctrl+Alt+E

    From there you'll see a number of specific exceptions you can enable your IDE to break on.

    For example: ArgumentNullException

提交回复
热议问题