Click here to Skip to main content
15,885,767 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I,m running a windows form application in Visual Studio 2008. While programming I find it handy to write some simple things to the output window of visual studio. But suddenly the things I wrote to the output window using Console.Writeline() didn't appear in the output window anymore.
Text that I write using Debug.WriteLine() still appear in the output window.

Does anyone know what can be the cause of this problem and how I can fix this.

Grtz,
Wannes
Posted
Updated 24-May-20 12:34pm

You should use the class Trace, defined inside the namespace System.Diagnostic:

C#
System.Diagnostic.Trace.WriteLine(...);
 
Share this answer
 
I know that I could/should use that.

But why did Console.WriteLine() suddenly stopped sending the text to the output window? There must be an explanation.

grtz,
Wannes
 
Share this answer
 
Comments
Sauro Viti 13-Jul-10 8:40am    
Console.WriteLine() is designed to write to the window of console applications. Try this: start a new project of type "Console application" and mix Console.WriteLine() and System.Diagnostic.Trace.WriteLine(). As result, the first will write to the console window (the one like Command prompt) and the second one write to the debugger output window.
Simply you are using that function in a way that is not the correct one, and you obtain unexpected/strange results.
Just use extension for redirecting stdout into visual studio
You could use this extension https://marketplace.visualstudio.com/items?itemName=NesviatypaskhaOleksii.VsConsoleOutput
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900