From 7bc1a05ea9e717b754bb745e031d1edba4bf4e71 Mon Sep 17 00:00:00 2001
From: Phyxion <7643972+Phyxion@users.noreply.github.com>
Date: Mon, 17 Feb 2020 14:10:26 +0100
Subject: [PATCH 1/2] Fixes #224
---
.../Exceptionless.Wpf.csproj | 1 -
.../ExceptionlessClientExtensions.cs | 35 -------------------
2 files changed, 36 deletions(-)
diff --git a/src/Platforms/Exceptionless.Wpf/Exceptionless.Wpf.csproj b/src/Platforms/Exceptionless.Wpf/Exceptionless.Wpf.csproj
index 4d5295c9..b693a65a 100644
--- a/src/Platforms/Exceptionless.Wpf/Exceptionless.Wpf.csproj
+++ b/src/Platforms/Exceptionless.Wpf/Exceptionless.Wpf.csproj
@@ -15,7 +15,6 @@
Exceptionless client for WPF applications. $(Description)
WPF;Exceptionless;Error;Report;Reporting;Exception;Logging;Log;ELMAH
true
- true
Exceptionless
Library
diff --git a/src/Platforms/Exceptionless.Wpf/ExceptionlessClientExtensions.cs b/src/Platforms/Exceptionless.Wpf/ExceptionlessClientExtensions.cs
index 6e8ab1df..24ebcba0 100644
--- a/src/Platforms/Exceptionless.Wpf/ExceptionlessClientExtensions.cs
+++ b/src/Platforms/Exceptionless.Wpf/ExceptionlessClientExtensions.cs
@@ -1,5 +1,4 @@
using System;
-using System.Threading;
using System.Windows.Threading;
using Exceptionless.Dependency;
using Exceptionless.Plugins;
@@ -7,40 +6,6 @@
namespace Exceptionless.Wpf.Extensions {
public static class ExceptionlessClientExtensions {
- private static ThreadExceptionEventHandler _onApplicationThreadException;
-
- public static void RegisterApplicationThreadExceptionHandler(this ExceptionlessClient client) {
- if (client == null)
- throw new ArgumentNullException(nameof(client));
-
- if (_onApplicationThreadException == null)
- _onApplicationThreadException = (sender, args) => {
- var contextData = new ContextData();
- contextData.MarkAsUnhandledError();
- contextData.SetSubmissionMethod("ApplicationThreadException");
-
- args.Exception.ToExceptionless(contextData, client).Submit();
- };
-
- try {
- System.Windows.Forms.Application.ThreadException -= _onApplicationThreadException;
- System.Windows.Forms.Application.ThreadException += _onApplicationThreadException;
- } catch (Exception ex) {
- client.Configuration.Resolver.GetLog().Error(typeof(ExceptionlessClientExtensions), ex, "An error occurred while wiring up to the application thread exception event.");
- }
- }
-
- public static void UnregisterApplicationThreadExceptionHandler(this ExceptionlessClient client) {
- if (client == null)
- throw new ArgumentNullException(nameof(client));
-
- if (_onApplicationThreadException == null)
- return;
-
- System.Windows.Forms.Application.ThreadException -= _onApplicationThreadException;
- _onApplicationThreadException = null;
- }
-
private static DispatcherUnhandledExceptionEventHandler _onApplicationDispatcherUnhandledException;
public static void RegisterApplicationDispatcherUnhandledExceptionHandler(this ExceptionlessClient client) {
From fc0f80411cfe265b37dea2d763de5d0dc6244a17 Mon Sep 17 00:00:00 2001
From: Phyxion <7643972+Phyxion@users.noreply.github.com>
Date: Mon, 17 Feb 2020 14:14:59 +0100
Subject: [PATCH 2/2] Update ExceptionlessWpfExtensions.cs
Saving...
---
src/Platforms/Exceptionless.Wpf/ExceptionlessWpfExtensions.cs | 2 --
1 file changed, 2 deletions(-)
diff --git a/src/Platforms/Exceptionless.Wpf/ExceptionlessWpfExtensions.cs b/src/Platforms/Exceptionless.Wpf/ExceptionlessWpfExtensions.cs
index f5f29e33..0ed10b94 100644
--- a/src/Platforms/Exceptionless.Wpf/ExceptionlessWpfExtensions.cs
+++ b/src/Platforms/Exceptionless.Wpf/ExceptionlessWpfExtensions.cs
@@ -21,7 +21,6 @@ public static void Register(this ExceptionlessClient client, bool showDialog = t
client.Configuration.AddPlugin();
client.Startup();
- client.RegisterApplicationThreadExceptionHandler();
client.RegisterApplicationDispatcherUnhandledExceptionHandler();
if (!showDialog)
@@ -40,7 +39,6 @@ public static void Unregister(this ExceptionlessClient client) {
throw new ArgumentNullException(nameof(client));
client.Shutdown();
- client.UnregisterApplicationThreadExceptionHandler();
client.UnregisterApplicationDispatcherUnhandledExceptionHandler();
client.SubmittingEvent -= OnSubmittingEvent;