yood.mp
yood.mp

Reputation: 231

How do you run a console application in the Visual Studio output window, instead of opening a new command prompt?

I'm developing a simple console application in Visual Studio 2008 and want to run it in the output window inside Visual Studio 2008, instead of having a separate command prompt window come up. Is there a way to do this?

Upvotes: 23

Views: 56863

Answers (4)

Gammerz
Gammerz

Reputation: 131

ctrl+F5 seems to "start without debugging" in the debugging menu.

Upvotes: 13

Harald Scheirich
Harald Scheirich

Reputation: 9764

If you run the console app in the post build step it's output will go to the output window. The inability to do this easily has been on of my biggest peeves with VS (any version)

Upvotes: 22

Jon Skeet
Jon Skeet

Reputation: 1503489

Does it actually have to be a console application? If you make it a WinForms app (even though it doesn't create any GUI elements) you'll get the console output in the Output window. However, you then can't read from console input, and obviously you won't get any output at all if you run from a real command line or in explorer. For simple test applications this may be fine, of course!

Upvotes: 6

Andrew
Andrew

Reputation: 12009

The only way I know of is to add it as an external tool and tick the Use output window checkbox when you define the tool.

Upvotes: 3

Related Questions