Click here to Skip to main content
15,949,741 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm running code and I want my debug output to write to a text file. how does this work?
I tried to write :
C#
TextWriterTraceListener[] listeners = new TextWriterTraceListener[] {
                new TextWriterTraceListener("W:\\C.txt"),
              new TextWriterTraceListener(Console.Out)

Debug.Listeners.AddRange(listeners);
Debug.WriteLine("Some Value", "Some Category");


but it still write to the output window...
What should I do?
thanks.
Posted
Updated 25-Nov-13 21:50pm
v3

1 solution

You might find many available implementation of a 'logging class', just Googling for [^].
 
Share this answer
 
Comments
Member 10304617 26-Nov-13 3:38am    
Thanks.
CPallini 26-Nov-13 3:49am    
You are welcome.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900