diff --git a/CHANGELOG.md b/CHANGELOG.md index a0deebe9db..742b75a37e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,9 @@ - Fixed memory leak when tracing is enabled ([#3432](https://github.com/getsentry/sentry-dotnet/pull/3432)) - `Scope.User.Id` now correctly defaults to the InstallationId unless it has been set otherwise ([#3425](https://github.com/getsentry/sentry-dotnet/pull/3425)) +### API Changes +- Removed `FirstChanceException` workaround for WinUI ([#3411](https://github.com/getsentry/sentry-dotnet/pull/3411)) + ### Dependencies - Bump CLI from v2.31.2 to v2.32.1 ([#3398](https://github.com/getsentry/sentry-dotnet/pull/3398)) diff --git a/src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs b/src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs index 3341abc2dd..513216ce9d 100644 --- a/src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs +++ b/src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs @@ -34,7 +34,6 @@ internal class WinUIUnhandledExceptionIntegration : ISdkIntegration private static readonly byte[] WinUIPublicKeyToken = Convert.FromHexString("de31ebe4ad15742b"); private static readonly Assembly? WinUIAssembly = GetWinUIAssembly(); - private Exception? _lastFirstChanceException; private IHub _hub = null!; private SentryOptions _options = null!; @@ -58,9 +57,6 @@ public void Register(IHub hub, SentryOptions options) // Hook the main event handler AttachEventHandler(); - - // First part of workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/7160 - AppDomain.CurrentDomain.FirstChanceException += (_, e) => _lastFirstChanceException = e.Exception; } private static Assembly? GetWinUIAssembly() @@ -127,12 +123,6 @@ private void WinUIUnhandledExceptionHandler(object sender, object e) return; } - // Second part of workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/7160 - if (exception.StackTrace is null) - { - exception = _lastFirstChanceException!; - } - // Set some useful data and capture the exception var description = "This exception was caught by the Windows UI global error handler."; if (!handled)