Having the Output of a Console Application in Visual Studio Instead of the Console

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

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

How to display Visual Studio Console Application output inside the IDE and not in command prompt?

Unfortunately, the answer seems to be no.

In Visual Studio, console applications are displayed on the command prompt and not inside Visual Studio itself. Meaning that Console.WriteLine method and similar ones write your output to the console window because your application type is Console Application.

You are able to write output to Visual Studio itself by using System.Diagnostics.Debug.WriteLine as mentioned on MSDN. That will cause the debug output to appear in the Output Window inside Visual Studio. In case you don't see that view, you can choose to show it by Debug => Windows => Output.

You should bare in mind that this is not what you asked for.

This "solution" is helpful just in case you want to debug parts of your code and don't want to open the command prompt but just see the relevant output inside the IDE.

In addition, you won't be able to give input back in this output view.

The most important thing, you will not be able to execute your application correctly outside of your coding environment. So, it will work only on the IDE but you won't be able to see this output when the application is on its own (as it meant to be as a console application).

Another solution, that you might like, is to work with Eclipse.

You said that you are familiar with Eclipse as a Java developer and now you work with C++ and don't get along with Visual Studio so far.

So, you can download Eclipse IDE for C/C++ Developers.

In there you will be familiar with the IDE and you will be able to display your output inside Eclipse without any weird and unnecessary workarounds.

Why doesn't Console.Writeline, Console.Write work in Visual Studio Express?

Console.WriteLine writes your output to the console window opened by your application (think black window with white text that appears when you open the Command Prompt.) Try System.Diagnostics.Debug.WriteLine instead.

C# console app finishing with code 0 instead of providing the output it's supposed to calculate

Console.WriteLine(String, Object) method signature requires the string include a format character, which you don't have.

If you want to use String interpolation, then that would look like

Console.WriteLine($"The future value of your investment is: {futureCapital}");

Visual Studio console output of external program started from library project using dynamic assembly loading

When you're using forms, it'll disable the console window. If you want to see the output, you'll need to manually enable it.

How do I show a console output/window in a forms application?



Related Topics



Leave a reply



Submit