Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Debug and Trace Write/WriteLine not outputting to output in Visual Studio 2010 C# Express

I can not get Debug or Trace to work in Visual Studio 2010 C# Express. I have "Redirect all output to immediate window" - Unchecked. Nothing is going to output window.

using System.Diagnostics;

Trace.Write("Hello World");
Trace.WriteLine("Hello World");
Debug.Write("Hello World2");
Debug.WriteLine("Hello World2");
like image 632
Mausimo Avatar asked Apr 19 '12 21:04

Mausimo


People also ask

How do I get console WriteLine output in Visual Studio?

In Visual Studio uppermost menu choose Debug > Windows > Output. It shows all Console. WriteLine("Debug MyVariable: " + MyVariable) when you get to them. Set breakpoint before, debug, and then use F11 to step through code line by line.

How do I show debug output in Visual Studio?

To see the debug output window, in Microsoft Visual Studio, click View, click Other Windows, and then click Output. You can view the debug output in this window only if the debugger is attached to the process that is writing to the output window.

Where does the trace WriteLine method write its output to?

By default, the output is written to an instance of DefaultTraceListener. This method calls the WriteLine method of the trace listener.

When you call debug write () to generate debugging messages output is sent to the?

Diagnostics. Debug. WriteLine will display in the output window ( Ctrl + Alt + O ), you can also add a TraceListener to the Debug.


Video Answer


2 Answers

Make sure that both checkboxes "Define DEBUG constant" and "Define TRACE constant" in project properties on page Build are checked.

like image 146
Ňuf Avatar answered Oct 17 '22 06:10

Ňuf


Right click in the output window and make sure 'Program Output' is checked.

like image 30
David Rinck Avatar answered Oct 17 '22 06:10

David Rinck