6
votes

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");
2
What type of project is it (console, web, etc.)?Cᴏʀʏ

2 Answers

18
votes

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

6
votes

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