1

I am using the following in my C# code:

System.Diagnostics.Debug.Write("xxx");

But when I look in the output window I cannot see anything even though my code does execute this line.

Is this the correct way to write messages that I can see in the VS2012?

  • http://stackoverflow.com/questions/1159755/where-does-system-diagnostics-debug-write-output-appear – andy Feb 08 '13 at 06:37
  • Is the writing of messages immediate or does it have to be flushed? –  Feb 08 '13 at 06:43

1 Answers1

4
  • Debug.Write will only function if the DEBUG build flag is set.

OR

  • Debug.Write calls may not display in the output window if you have the Visual Studio option "Redirect all Output Window text to the Immediate Window" checked under the menu

Tools > Options > Debugging > General.

To display "Tools > Options > Debugging", check the box next to "Tools > Options > Show All Settings".

Debugging

Vishal Suthar
  • 17,013
  • 3
  • 59
  • 105