Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I make Visual Studio pause after executing a console application in debug mode?

I have a collection of Boost unit tests I want to run as a console application.

When I'm working on the project and I run the tests I would like to be able to debug the tests, and I would like to have the console stay open after the tests run.

I see that if I run in release mode the console window stays up after the program exits, but in debug mode this is not the case.

I do not want to add 'system("pause");' or any other hacks like reading a character to my program. I just want to make Visual Studio pause after running the tests with debugging like it would if I were running in release mode. I would also like it if the output of tests were captured in one of Visual Studio's output windows, but that also seems to be harder than it should be.

How can I do this?

like image 265
Jason Dagit Avatar asked Oct 11 '08 00:10

Jason Dagit


People also ask

How do I pause a program in Visual Studio?

Select the left margin or press F9 next to the line of code you would like to stop at. Run your code or hit Continue (F5) and your program will pause prior to execution at the location you marked.

How do you pause a console window?

Execution of a batch script can also be paused by pressing CTRL-S (or the Pause|Break key) on the keyboard, this also works for pausing a single command such as a long DIR /s listing. Pressing any key will resume the operation.

How do I stop execution in Visual Studio?

Try: Ctrl + Alt + M , that should do it.


1 Answers

Try to run the application with the Ctrl + F5 combination.

like image 107
Cichy Avatar answered Sep 18 '22 23:09

Cichy