Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot get Console.Writeline to redirect to visual studio window [duplicate]

I have a program that just does Console.WriteLine("abc");

I would like to get that output to be within the visual studio window rather than in a cmd window that pops up.

I have tried what was suggested at this SO link here but it hasn't helped.

I have done File..New...Project..Visual C#.. Windows.. Console Application
enter image description here

And i've gone to debug..options and settings.. then ticked "Redirect all output text to the intermediate window"

enter image description here

enter image description here

None of that helps though!

The command window still appears when I click Start / Hit F5.

Really i'm looking for a cmd window to not appear and output just to be redirected to the output window

enter image description here

enter image description here

enter image description here

ADDED

It has been suggested that I check the Intermediate window (Ctrl-Alt-I)

It is coming up as Blank.

It has been suggested that I Go to project..properties and change the type of the application to a Windows Application.

When I do that, I get no cmd window come up (fine). But I don't see any cmd output in the output window, or the intermediate window. And the intermediate window is empty.

Here is for the case where I have the cmd window coming up (so when the type is set to console)

Notice the output window doesn't have the cmd output, and the intermediate window is empty.

enter image description here

enter image description here

Here is the case for when I have set the type to Windows application so no cmd window comes up

ah I see it in the output window.. I might've had to scroll a bit.. or clear it first to make it clearer. nothing in the intermediate window, but I see in the output window.

enter image description here

like image 287
barlop Avatar asked Aug 02 '14 06:08

barlop


1 Answers

In the same question you linked to, there's another answer. You need to change the project from a Console Application to a Windows application, apart from the steps you carried out above.

enter image description here

This causes the output to go to the Output window:

enter image description here

like image 164
Gigi Avatar answered Sep 29 '22 03:09

Gigi