Debug.WriteLine does not wrok in framework 2.0

  • Thread starter Thread starter Daimy
  • Start date Start date
D

Daimy

Debug.WriteLine does not wrok in framework 2.0

I wrote codes in C# 2005.

It does not output anything in the output window.

Is there any way to let it work?
 
You need to define the DEBUG constant - either through code (using #define)
or through the IDE
 
I added DEBUG definition and added the codes below

Debug.Listeners.Add(new TextWriterTraceListener("c:\\b.txt"));
Debug.AutoFlush = true;
Debug.WriteLine("debug");

The result is that the "debug" string is written to "b.txt", but it is not
written to the output window.
 
Back
Top