From a9375e777eaa6be2dadf848dfb41b9f425ee757f Mon Sep 17 00:00:00 2001 From: morkt Date: Mon, 3 Aug 2015 22:25:13 +0400 Subject: [PATCH] added logging of unhandled exceptions in DEBUG build. --- App.xaml.cs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/App.xaml.cs b/App.xaml.cs index d612cc04..4f705904 100644 --- a/App.xaml.cs +++ b/App.xaml.cs @@ -67,6 +67,12 @@ namespace GARbro.GUI Trace.AutoFlush = true; #endif Trace.WriteLine ("ApplicationStartup --------------------------------", "GARbro.GUI.App"); + this.DispatcherUnhandledException += (s, args) => + { + Trace.WriteLine (string.Format ("Unhandled exception caught: {1}", args.Exception.Message), + "GARbro.GUI.App"); + Trace.WriteLine (args.Exception.StackTrace, "Stack trace"); + }; try { if (0 != e.Args.Length) @@ -85,7 +91,7 @@ namespace GARbro.GUI if (string.IsNullOrEmpty (InitPath)) InitPath = Directory.GetCurrentDirectory(); - CurrentPath = ""; + CurrentPath = ""; } void ApplicationExit (object sender, ExitEventArgs e)