Click here to Skip to main content
15,214,114 members
Rate this:
Please Sign up or sign in to vote.
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
Rate this:
Please Sign up or sign in to vote.

Solution 1

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

System.Diagnostic.Trace.WriteLine(...);
   
Rate this:
Please Sign up or sign in to vote.

Solution 2

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
   
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.
Rate this:
Please Sign up or sign in to vote.

Solution 3

Just use extension for redirecting stdout into visual studio
You could use this extension https://marketplace.visualstudio.com/items?itemName=NesviatypaskhaOleksii.VsConsoleOutput
   

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




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100