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

The reason why is that your exceptions are not unhandled. The unit testing framework is handling the exceptions under the hood and converting them to failures.

What you need to do instead is to break on thrown exceptions. If you combine this with enabling "Just My Code" (on by default) you should get the behavior you are expecting. Visual Studio will only break when exceptions thrown by your code occur.


For me I am using VS 2010 and 2015, Go to: Tools, Options, Debugging, General: you need to make sure the "Enable Just My Code" and "Enable the exception assistant" should be checked.


The unit testing framework handles the exception so visual studio thinks that the exception is handled.