What is the simplest way to run a C# program in linux (eg with `dotnet`) and be able to see the output of Debug.Print statements? All the instructions I find on Google only show how to do this in VS Code and I am not currently using VS Code.

@mcc Before you call Debug.Print, try adding these lines:

Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
Trace.AutoFlush = true;

(I'm using .NET 8)

@mcc Super simple examples:

This just outputs "Hello, World!":

private static void Main(string[] args)
{
Debug.Print("This is a debug message.");
Console.WriteLine("Hello, World!");
}

This outputs "This is a debug message." and "Hello, World!":

private static void Main(string[] args)
{
Trace.Listeners.Add(new TextWriterTraceListener(Console.Out));
Trace.AutoFlush = true;

Debug.Print("This is a debug message.");
Console.WriteLine("Hello, World!");
}