Debug / Trace output in MonoDevelop

Where can I see System.Diagnostics.Debug and System.Diagnostics.Trace output in MonoDevelop? I would think that it should appear in the ApplicationOutput window, but not found anywhere.

+4
source share
2 answers

The output window of the application displays the results of Console.WriteLine.

If you want something that works with Visual Studio on Windows, as well as on Mono, add a static method to your Program.cs file that looks like this:

public static void WriteLine(String fmt, params Object[] args) { string op; if (fmt == null) op = String.Empty; else if (args == null || args.Length == 0) op = fmt; else op = String.Format(fmt, args); Trace.WriteLine(op); DateTime now = DateTime.Now; string outString = String.Format("{0,4}-{1,2:0#}-{2,2:0#} {3,2:0#}:{4,2:0#}:{5,2:0#} : {6}", now.Year, now.Month, now.Day, now.Hour, now.Minute, now.Second, op); Console.WriteLine(outString); } 
+3
source

Trace listeners by default write to System.Diagnostics.Debugger.Log, which is only supported in Mono HEAD.

If you want to see the output outside the debugger or use older versions of Mono, add a custom trace listener that will be written to the console.

0
source

All Articles