private static void WriteToDebugger(string message) { if (Debugger.IsLogging()) { Debugger.Log(0, null, message); } else { Interop.Kernel32.OutputDebugString(message ?? string.Empty); } } }