public void PrintManagedExceptions() { if (context.Runtime != null) { foreach (ClrThread thread in this.context.Runtime.Threads) { ClrException lastException = thread.CurrentException; if (lastException != null) { context.Write("Exception on thread {0} (OS:{1}): ", thread.ManagedThreadId, thread.OSThreadId); this.PrintException(lastException); if (lastException.Inner != null) { this.PrintException(lastException.Inner); } } } } }