I\'m trying to debug a C# application. The method:
System.Diagnostics.Debug.WriteLine(\"something\");
should do the work, but in the Output
You need to explicitly add the system's Console
as a TraceListener in order for the output to appear in the console. According to Microsoft's documentation, this code should do the trick. This is C# code, but the link I provided contains examples for the other .NET languages.
using System;
using System.Data;
using System.Diagnostics;
class Test
{
static void Main()
{
Debug.Listeners.Add(new TextWriterTraceListener(Console.Out));
Debug.AutoFlush = true;
Debug.Indent();
Debug.WriteLine("Entering Main");
Console.WriteLine("Hello World.");
Debug.WriteLine("Exiting Main");
Debug.Unindent();
}
}