From 15bbe80b9bd5813ec4f3cdf213edf454ea2aaa2f Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Mon, 13 Nov 2023 02:22:38 +0100 Subject: [PATCH 1/2] fix: remove WinUI integration from mobile --- .../Integrations/WinUIUnhandledExceptionIntegration.cs | 2 +- src/Sentry/SentryOptions.cs | 6 +++--- src/Sentry/SentryOptionsExtensions.cs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs b/src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs index 78c9603f77..a52f3951c1 100644 --- a/src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs +++ b/src/Sentry/Integrations/WinUIUnhandledExceptionIntegration.cs @@ -1,4 +1,4 @@ -#if NET5_0_OR_GREATER +#if NET5_0_OR_GREATER && !__MOBILE__ using Sentry.Extensibility; using Sentry.Internal; diff --git a/src/Sentry/SentryOptions.cs b/src/Sentry/SentryOptions.cs index b363d77fd1..b4124017d2 100644 --- a/src/Sentry/SentryOptions.cs +++ b/src/Sentry/SentryOptions.cs @@ -186,7 +186,7 @@ internal IEnumerable Integrations } #endif -#if NET5_0_OR_GREATER +#if NET5_0_OR_GREATER && !__MOBILE__ if ((_defaultIntegrations & DefaultIntegrations.WinUiUnhandledExceptionIntegration) != 0) { yield return new WinUIUnhandledExceptionIntegration(); @@ -1184,7 +1184,7 @@ public SentryOptions() #if HAS_DIAGNOSTIC_INTEGRATION | DefaultIntegrations.SentryDiagnosticListenerIntegration #endif -#if NET5_0_OR_GREATER +#if NET5_0_OR_GREATER && !__MOBILE__ | DefaultIntegrations.WinUiUnhandledExceptionIntegration #endif ; @@ -1283,7 +1283,7 @@ internal enum DefaultIntegrations #if HAS_DIAGNOSTIC_INTEGRATION SentryDiagnosticListenerIntegration = 1 << 5, #endif -#if NET5_0_OR_GREATER +#if NET5_0_OR_GREATER && !__MOBILE__ WinUiUnhandledExceptionIntegration = 1 << 6, #endif } diff --git a/src/Sentry/SentryOptionsExtensions.cs b/src/Sentry/SentryOptionsExtensions.cs index d04a050fb5..5481047545 100644 --- a/src/Sentry/SentryOptionsExtensions.cs +++ b/src/Sentry/SentryOptionsExtensions.cs @@ -83,7 +83,7 @@ public static void DisableNetFxInstallationsIntegration(this SentryOptions optio public static void DisableAppDomainProcessExitFlush(this SentryOptions options) => options.RemoveDefaultIntegration(SentryOptions.DefaultIntegrations.AppDomainProcessExitIntegration); -#if NET5_0_OR_GREATER +#if NET5_0_OR_GREATER && !__MOBILE__ /// /// Disables WinUI exception handler /// From f1ccafb2289d0fa328371b8ce8be4f31bb8af06f Mon Sep 17 00:00:00 2001 From: Ivan Dlugos Date: Mon, 13 Nov 2023 13:18:00 +0100 Subject: [PATCH 2/2] chore: changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1cfa5cff56..ff9776d24a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -80,6 +80,10 @@ Additionally, we're dropping support for some of the old target frameworks, plea - Contexts now inherits from `IDictionary` rather than `ConcurrentDictionary`. The specific dictionary being used is an implementation detail. ([#2729](https://github.com/getsentry/sentry-dotnet/pull/2729)) - Transaction names for ASP.NET Core are now consistently named `HTTP-VERB /path` (e.g. `GET /home`). Previously the leading forward slash was missing for some endpoints. ([#2808](https://github.com/getsentry/sentry-dotnet/pull/2808)) +### Fixes + +- Don't add WinUI exception integration on mobile platforms ([#2821](https://github.com/getsentry/sentry-dotnet/pull/2821)) + ### Features #### Native AOT