-1

Have a look at the picture. No matter where i put console.writeline, nothing is showing in output. Where could be a mistake? Is something wrong with my output editor or what?

enter image description here

Community
  • 1
  • 1
user7968180
  • 145
  • 1
  • 15
  • 4
    `Console.WriteLine` writes to the *console*, not to the "Output" window. Use `Debug.WriteLine` instead. – Cody Gray - on strike Jun 04 '17 at 12:32
  • How can i display console window instead of Output window? I have only found how to display output window. – user7968180 Jun 04 '17 at 12:48
  • Windows applications do not typically have console windows. Why do you need one? – Cody Gray - on strike Jun 04 '17 at 12:57
  • Yeah. Console window is what you get in a CONSOLE application. One that opens a window when you start it (the console) and is typsically a command line app (though you CAN open the console window also in windows apps and just use it for stuff like debugging output= – TomTom Jun 04 '17 at 13:33
  • I just asked because in java eclipse there is console window all the time. So you dont have be so astonished that i cannot find and without you have no idea what to think about it. Bye – user7968180 Jun 04 '17 at 14:45
  • Most likely, Eclipse just calls the "Console Window" what Visual Studio calls the "Output Window". As TomTom says, in Windows, a console is what you get when you run the command prompt. – Cody Gray - on strike Jun 05 '17 at 09:18

2 Answers2

1

Use Debug.WriteLine to write to the Output window as you want.

See also What's the difference between Console.WriteLine() vs Debug.WriteLine()?

mjwills
  • 23,389
  • 6
  • 40
  • 63
1

So you have 2 questions instead of one: your main one and the comment "How can i display console window instead of Output window?"

  1. You can write to VS output by using Debug.WriteLine. This requires System.Diagnostics namespace.
  2. You can also run console window alongside with your windows application. Right click the project in Solution Explorer, select Properties, change Output Type to "Console Application" like this.
Rogger Tân
  • 71
  • 2
  • 6