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

53,224

Solution 1

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)

Solution 2

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

Solution 3

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!

Solution 4

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.

Solution 5

It is a fairly old question, but as there is no answer marked as solution yet, try the answer given over here: Having the output of a console application in Visual Studio instead of the console

Share:
53,224
yood.mp
Author by

yood.mp

Updated on July 09, 2022

Comments

  • yood.mp
    yood.mp almost 2 years

    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?

  • Sarah Vessels
    Sarah Vessels almost 15 years
    To do this, in the Solution Explorer, right-click on your project, choose Properties. Go to the Build Events tab and hit 'Edit Post-build ...'. In the new window that opens, hit the 'Macros >>' button and double click on TargetPath so that it appears in the text box. Hit OK and save the project, then Build it.
  • Mark Meuer
    Mark Meuer over 13 years
    Basically the same answer was given here: stackoverflow.com/questions/2518509/…