diff --git a/QuickLook/App.config b/QuickLook/App.config index 4b4680b3..d7d44a48 100644 --- a/QuickLook/App.config +++ b/QuickLook/App.config @@ -14,6 +14,7 @@ + diff --git a/QuickLook/App.xaml.cs b/QuickLook/App.xaml.cs index 66777328..15f3f65d 100644 --- a/QuickLook/App.xaml.cs +++ b/QuickLook/App.xaml.cs @@ -16,6 +16,7 @@ // along with this program. If not, see . using System; +using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; @@ -44,9 +45,13 @@ namespace QuickLook { AppDomain.CurrentDomain.UnhandledException += (sender, args) => { - MessageBox.Show(((Exception) args.ExceptionObject).ToString()); + //MessageBox.Show(((Exception) args.ExceptionObject).ToString()); - Shutdown(); + const string source = "QuickLook Application Error"; + if (!EventLog.SourceExists(source)) + EventLog.CreateEventSource(source, "Application"); + EventLog.WriteEntry(source, ((Exception) args.ExceptionObject).ToString(), + EventLogEntryType.Error); }; base.OnStartup(e);