Skip to content

Commit 79b1dc3

Browse files
chore: Removed FirstChanceException workaround for WinUI (#3411)
* removed workaround * Update CHANGELOG.md --------- Co-authored-by: James Crosswell <[email protected]>
1 parent bed0f0c commit 79b1dc3

File tree

2 files changed

+3
-10
lines changed

2 files changed

+3
-10
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,9 @@
2525
- Fixed memory leak when tracing is enabled ([#3432](https://github.com/getsentry/sentry-dotnet/pull/3432))
2626
- `Scope.User.Id` now correctly defaults to the InstallationId unless it has been set otherwise ([#3425](https://github.com/getsentry/sentry-dotnet/pull/3425))
2727

28+
### API Changes
29+
- Removed `FirstChanceException` workaround for WinUI ([#3411](https://github.com/getsentry/sentry-dotnet/pull/3411))
30+
2831
### Dependencies
2932

3033
- Bump CLI from v2.31.2 to v2.32.1 ([#3398](https://github.com/getsentry/sentry-dotnet/pull/3398))

src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ internal class WinUIUnhandledExceptionIntegration : ISdkIntegration
3434
private static readonly byte[] WinUIPublicKeyToken = Convert.FromHexString("de31ebe4ad15742b");
3535
private static readonly Assembly? WinUIAssembly = GetWinUIAssembly();
3636

37-
private Exception? _lastFirstChanceException;
3837
private IHub _hub = null!;
3938
private SentryOptions _options = null!;
4039

@@ -58,9 +57,6 @@ public void Register(IHub hub, SentryOptions options)
5857

5958
// Hook the main event handler
6059
AttachEventHandler();
61-
62-
// First part of workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/7160
63-
AppDomain.CurrentDomain.FirstChanceException += (_, e) => _lastFirstChanceException = e.Exception;
6460
}
6561

6662
private static Assembly? GetWinUIAssembly()
@@ -127,12 +123,6 @@ private void WinUIUnhandledExceptionHandler(object sender, object e)
127123
return;
128124
}
129125

130-
// Second part of workaround for https://github.com/microsoft/microsoft-ui-xaml/issues/7160
131-
if (exception.StackTrace is null)
132-
{
133-
exception = _lastFirstChanceException!;
134-
}
135-
136126
// Set some useful data and capture the exception
137127
var description = "This exception was caught by the Windows UI global error handler.";
138128
if (!handled)

0 commit comments

Comments
 (0)