m_poorUser m_poorUser - 9 days ago 4
C# Question

Writing to output window of Visual Studio?

I am new to C#. I am trying to write a message to output window for debugging purposes. I searched for a function like java's

system.out.println("")
. Tried
Debug.Write
,
Console.Write
,
Trace.Write
. It does not give an error but not print anything too.

"Define DEBUG constant" and "Define TRACE constant" options are checked.

Tools > Options > Debugging > "Redirect all Output Window text to the Immediate Window" option is not checked.

Configuration: Active (Debug)

Note: I created project with wizard as "Windows Forms Application" if relevant. I have no idea where to look.

Answer

Add the System.Diagnostics namespace then you can use Debug.WriteLine() to quickly print a message to the output window of the IDE. For more details please refer to these links:

Comments