From 5185523a61161919c0a14780a1c9e05db2373fec Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 23 Nov 2023 12:16:01 +1300 Subject: [PATCH 1/3] FrameworkSupportsAot now enabled for net8.0 and later only --- src/Directory.Build.props | 4 ++-- .../Sentry.Extensions.Logging.csproj | 9 ++++++--- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index 47a7372194..bd2636a51d 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -35,8 +35,8 @@ $(MSBuildThisFileDirectory)CodeAnalysis.ruleset - - + + true diff --git a/src/Sentry.Extensions.Logging/Sentry.Extensions.Logging.csproj b/src/Sentry.Extensions.Logging/Sentry.Extensions.Logging.csproj index 0b41c45213..ac9d9c63eb 100644 --- a/src/Sentry.Extensions.Logging/Sentry.Extensions.Logging.csproj +++ b/src/Sentry.Extensions.Logging/Sentry.Extensions.Logging.csproj @@ -1,7 +1,7 @@  - net6.0;netstandard2.0 + net8.0;net6.0;netstandard2.0 $(PackageTags);Logging;Microsoft.Extensions.Logging Official Microsoft.Extensions.Logging integration for Sentry - Open-source error tracking that helps developers monitor and fix crashes in real time. @@ -20,12 +20,15 @@ - - + + + + + From a1343d50e5f9e15e121dcac54656763b365d6870 Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 23 Nov 2023 12:45:07 +1300 Subject: [PATCH 2/3] Update Directory.Build.props --- src/Directory.Build.props | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Directory.Build.props b/src/Directory.Build.props index bd2636a51d..74cda5ab08 100644 --- a/src/Directory.Build.props +++ b/src/Directory.Build.props @@ -37,6 +37,11 @@ + true From 581a59f4468ba7d2979f843bd6dc471df1134a7a Mon Sep 17 00:00:00 2001 From: James Crosswell Date: Thu, 23 Nov 2023 13:35:25 +1300 Subject: [PATCH 3/3] Aligned dependencies with target framework version --- .../Sentry.Extensions.Logging.csproj | 4 +++- src/Sentry.Extensions.Logging/SentryLogger.cs | 5 +++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Sentry.Extensions.Logging/Sentry.Extensions.Logging.csproj b/src/Sentry.Extensions.Logging/Sentry.Extensions.Logging.csproj index ac9d9c63eb..e416c0ab12 100644 --- a/src/Sentry.Extensions.Logging/Sentry.Extensions.Logging.csproj +++ b/src/Sentry.Extensions.Logging/Sentry.Extensions.Logging.csproj @@ -20,13 +20,15 @@ - + + + diff --git a/src/Sentry.Extensions.Logging/SentryLogger.cs b/src/Sentry.Extensions.Logging/SentryLogger.cs index 284a5c371b..6e91e40fc0 100644 --- a/src/Sentry.Extensions.Logging/SentryLogger.cs +++ b/src/Sentry.Extensions.Logging/SentryLogger.cs @@ -23,7 +23,12 @@ internal SentryLogger( _hub = hub; } +#if NET8_0_OR_GREATER + public IDisposable BeginScope(TState state) where TState : notnull + => _hub.PushScope(state); +#else public IDisposable BeginScope(TState state) => _hub.PushScope(state); +#endif public bool IsEnabled(LogLevel logLevel) => _hub.IsEnabled