user2381422
user2381422

Reputation: 5805

How to stop at the first assert failed in Visual Studio?

How to stop at the first assert failed in Visual Studio?

When I debug, for each assert that fails I get pop-up windows one on top of the other. But I don't want that behaviour, I need the program to stop at the first failed assert, so that I can debug from there.

enter image description here

Thanks

Upvotes: 9

Views: 12594

Answers (1)

Justin R.
Justin R.

Reputation: 24021

  1. Make sure that you have the Native debugger enabled: Select your project in Solution Explorer, then select Debug > YourProject Properties (at the bottom). Choose Debug from the menu on the left, then under Enable Debuggers make sure the type is either Mixed or Native.
  2. Make sure you're breaking on assert failures. Go to:

VS 2015: Menu->Debug->Windows->Exception Settings

Pre-VS 2015: Debug > Exceptions, expand Win32 Exceptions, and check Assert Failed:

enter image description here

Upvotes: 10

Related Questions