Having the output of a console application in Visual Studio instead of the console

devoured elysium picture devoured elysium · Mar 30, 2010 · Viewed 203.4k times · Source

When doing a console application in Java with Eclipse, I see the output being put in a text box in the IDE itself, instead of having a console popping up like in Visual Studio. This comes in handy, as even after the program has exited, I can still make good use of the text that was written in it, as it doesn't get erased until I run it again. Is it possible to achieve anything like that with Visual Studio? I know that instead of doing

System.Console.WriteLine(str);

I can do

System.Diagnostics.Debug.WriteLine(str);

but it is not quite the same thing, as you get a lot of "junk" in the Output window, as all the loaded symbols and such.

Even better, is it possible to have everything done in the IDE itself, when you run your application, instead of having the console running?

Answer

SharpSteve picture SharpSteve · Mar 31, 2010

In the Tools -> Visual Studio Options Dialog -> Debugging -> Check the "Redirect All Output Window Text to the Immediate Window".