Csharp/C Sharp by API/System.Diagnostics/DefaultTraceListener
new DefaultTraceListener()
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Text;
public class MainClass
{
public static void Main()
{
DefaultTraceListener dtl = new DefaultTraceListener();
dtl.AssertUiEnabled = true;
Trace.Listeners.Add(dtl);
}
}