Dave Mateer
Dave Mateer

Reputation: 6626

Visual Studio - Assert not stopping when fails

Just moved from VS2010 Professional to Premium.

When I hit a failing Assert using MSTEST, it doesn't stop in the debugger anymore (it does produce a correct fail in the Test Results)

Problem: How to get the debugger to stop on the failing assert when I run tests

enter image description here

Upvotes: 12

Views: 8203

Answers (2)

JaredPar
JaredPar

Reputation: 754525

In order to do this you'll need to do the following

  • Disable Just My Code: Tools -> Options -> Debugger. Uncheck "Enable Just My Code"
  • Enable Break on throw: Debug -> Exceptions. Check "thrown" for CLR exceptions.

Upvotes: 17

khr055
khr055

Reputation: 29032

I've seen this before when I run failed tests with (CTRL + R, F) which just runs the failed tests where (CTRL + R, CTRL + F) debugs the tests and breaks when the assert fails. Let me know if this helps.

Upvotes: 1

Related Questions