Releases: getsentry/sentry-dotnet
4.0.0
This major release includes many exciting new features including support for Profiling and Metrics(preview), AOT with Native Crash Reporting, Spotlight, Screenshots on MAUI and much more. Details about these features and other changes are below.
.NET target framework changes
We're dropping support for some of the old target frameworks, please check this GitHub Discussion for details on why.
-
Replace support for .NET Framework 4.6.1 with 4.6.2 (#2786)
.NET Framework 4.6.1 was announced on Nov 30, 2015. And went out of support over a year ago, on Apr 26, 2022.
-
Drop .NET Core 3.1 and .NET 5 support (#2787)
-
Dropped netstandard2.0 support for Sentry.AspNetCore (#2807)
-
Replace support for .NET 6 on mobile (e.g:
net6.0-android) with .NET 7 (#2624).NET 6 on mobile has been out of support since May 2023 and with .NET 8, it's no longer possible to build .NET 6 Mobile specific targets.
For that reason, we're moving the mobile-specific TFMs fromnet6.0-platformtonet7.0-platform.Mobile apps still work on .NET 6 will pull the
Sentry.NET 6, which offers the .NET-only features,
without native/platform-specific bindings and SDKs. See this ticket for more details. -
MAUI dropped Tizen support (#2734)
Sentry Self-hosted Compatibility
If you're using sentry.io this change does not affect you.
This SDK version is compatible with a self-hosted version of Sentry 22.12.0 or higher. If you are using an older version of self-hosted Sentry (aka on-premise), you will need to upgrade.
Significant change in behavior
- 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) - Setting
SentryOptions.Dsntonullnow throwsArgumentNullExceptionduring initialization. (#2655) - Enable
CaptureFailedRequestsby default (#2688) - Added
Sentrynamespace to global usings whenImplicitUsingsis enabled (#3043)
If you have conflicts, you can opt out by adding the following to yourcsproj:
<PropertyGroup>
<SentryImplicitUsings>false</SentryImplicitUsings>
</PropertyGroup>
- Transactions' spans are no longer automatically finished with the status
deadline_exceededby the transaction. This is now handled by the Relay.- Customers self hosting Sentry must use verion 22.12.0 or later (#3013)
- The
User.IpAddressis now set to{{auto}}by default, even when sendDefaultPII is disabled (#2981)- The "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io can be used to control this instead
- The
DiagnosticLoggersignature forLogWarningchanged to take theexceptionas the first parameter. That way it no longer gets mixed up with the TArgs. (#2987)
API breaking Changes
If you have compilation errors you can find the affected types or overloads missing in the changelog entries below.
Changed APIs
- Class renamed
Sentry.UsertoSentry.SentryUser(#3015) - Class renamed
Sentry.RuntimetoSentry.SentryRuntime(#3016) - Class renamed
Sentry.SpantoSentry.SentrySpan(#3021) - Class renamed
Sentry.TransactiontoSentry.SentryTransaction(#3023) - Rename iOS and MacCatalyst platform-specific options from
CocoatoNative(#2940) - Rename iOS platform-specific options
EnableCocoaSdkTracingtoEnableTracing(#2940) - Rename Android platform-specific options from
AndroidtoNative(#2940) - Rename Android platform-specific options
EnableAndroidSdkTracingandEnableAndroidSdkBeforeSendtoEnableTracingandEnableBeforeSendrespectively (#2940) - Rename iOS and MacCatalyst platform-specific options from
iOStoCocoa(#2929) ITransactionhas been renamed toITransactionTracer. You will need to update any references to these interfaces in your code to use the new interface names (#2731, #2870)DebugImageandDebugMetamoved toSentry.Protocolnamespace. (#2815)SentryClient.Disposeis no longer obsolete (#2842)ISentryClient.CaptureEventoverloads have been replaced by a single method accepting optionalHintandScopeparameters. You will need to passhintas a named parameter from code that callsCaptureEventwithout passing ascopeargument. (#2749)TransactionContextandSpanContextconstructors were updated. If you're constructing instances of these classes, you will need to adjust the order in which you pass parameters to these. (#2694, #2696)- The
DiagnosticLoggersignature forLogErrorandLogFatalchanged to take theexceptionas the first parameter. That way it no longer gets mixed up with the TArgs. TheDiagnosticLoggernow also receives an overload forLogErrorandLogFatalthat accepts a message only. (#2715) Distributionadded toIEventLike. (#2660)StackFrame'sImageAddress,InstructionAddress, andFunctionIdchanged tolong?. (#2691)DebugImage.ImageAddresschanged tolong?. (#2725)- Contexts now inherit from
IDictionaryrather thanConcurrentDictionary. The specific dictionary being used is an implementation detail. (#2729) - The method used to configure a Sentry Sink for Serilog now has an additional overload. Calling
WriteTo.Sentry()with no arguments will no longer attempt to initialize the SDK (it has optional arguments to configure the behavior of the Sink only). If you want to initialize Sentry at the same time you configure the Sentry Sink then you will need to use the overload of this method that accepts a DSN as the first parameter (e.g.WriteTo.Sentry("https://[email protected]:65535/2147483647")). (#2928)
Removed APIs
- SentrySinkExtensions.ConfigureSentrySerilogOptions is now internal. If you were using this method, please use one of the
SentrySinkExtensions.Sentryextension methods instead. (#2902) - A number of
[Obsolete]options have been removed (#2841)BeforeSend- useSetBeforeSendinstead.BeforeSendTransaction- useSetBeforeSendTransactioninstead.BeforeBreadcrumb- useSetBeforeBreadcrumbinstead.CreateHttpClientHandler- useCreateHttpMessageHandlerinstead.ReportAssemblies- useReportAssembliesModeinstead.KeepAggregateException- this property is no longer used and has no replacement.DisableTaskUnobservedTaskExceptionCapturemethod has been renamed toDisableUnobservedTaskExceptionCapture.DebugDiagnosticLogger- useTraceDiagnosticLoggerinstead.
- A number of iOS/Android-specific
[Obsolete]options have been removed (#2856)Distribution- useSentryOptions.Distributioninstead.EnableAutoPerformanceTracking- useSetBeforeSendTransactioninstead.EnableCoreDataTracking- useEnableCoreDataTracinginstead.EnableFileIOTracking- useEnableFileIOTracinginstead.EnableOutOfMemoryTracking- useEnableWatchdogTerminationTrackinginstead.EnableUIViewControllerTracking- useEnableUIViewControllerTracinginstead.StitchAsyncCode- no longer available.ProfilingTracesInterval- no longer available.ProfilingEnabled- useProfilesSampleRateinstead.
- Obsolete
SystemClockconstructor removed, useSystemClock.Clockinstead. (#2856) - Obsolete `Runtime.Clone...
4.0.0-beta.9
Features
- Added support for capturing built in metrics from the System.Diagnostics.Metrics API (#3052)
Significant change in behavior
- Added
Sentrynamespace to global usings whenImplicitUsingsis enabled (#3043)
If you have conflicts, you can opt-out by adding the following to yourcsproj:
<PropertyGroup>
<SentryImplicitUsings>false</SentryImplicitUsings>
</PropertyGroup>
Features
SentrySdk.Metrics.Setnow additionally acceptsstringas value (#3092)- Timing metrics can now be captured with
SentrySdk.Metrics.StartTimer(#3075)
Fixes
- Fixed an issue with tag values in metrics not being properly serialized (#3065)
- Moved the binding to MAUI events for breadcrumb creation from
WillFinishLaunchingtoFinishedLaunching. This delays the initial instantiation ofapp. (#3057) - The SDK no longer adds the
WinUIUnhandledExceptionIntegrationon non Windows platforms (#3055) - The scope transaction is now correctly set for Otel transactions (#3072)
- Native integration logging on macOS (#3079)
- Native linking of cURL library when targeting platform-specific TFMs (e.g.
net8.0-macos) (#3080)
Dependencies
3.41.4
4.0.0-beta.8
Features
- Experimental pre-release availability of Metrics. We're exploring the use of Metrics in Sentry. The API will very likely change and we don't yet have any documentation. (#2949)
Significant change in behavior
- Transactions' spans are no longer automatically finished with status
deadline_exceededby the transaction. This is now handled by the Relay.- Customers self hosting Sentry must use verion 22.12.0 or later (#3013)
API breaking Changes
Changed APIs
- Class renamed
Sentry.UsertoSentry.SentryUser(#3015) - Class renamed
Sentry.RuntimetoSentry.SentryRuntime(#3016) - Class renamed
Sentry.SpantoSentry.SentrySpan(#3021) - Class renamed
Sentry.TransactiontoSentry.SentryTransaction(#3023)
Dependencies
4.0.0-beta.7
Features
- MAUI Screenshot support. You can opt-in via
SentryMauiOptions.AttachScreenshots(#2965)- Supports Android and iOS only. Windows is not supported.
- MAUI: App context has
in_foregroundindicating whether app was on the background or foreground. (#2983)
Fixes
- Fixed an issue when using the SDK together with Open Telemetry
1.5.0and newer where the SDK would create transactions for itself. The fix is backwards compatible. (#3001)
Significant change in behavior
- The User.IpAddress is now set to {{auto}} by default, even when sendDefaultPII is disabled (#2981)
- The "Prevent Storing of IP Addresses" option in the "Security & Privacy" project settings on sentry.io can be used to control this instead
- The
DiagnosticLoggersignature forLogWarningchanged to take theexceptionas the first parameter. That way it does no longer get mixed up with the TArgs. (#2987)
Dependencies
4.0.0-beta.6
4.0.0-beta.5
4.0.0-beta.4
Fixes
- Workaround a .NET 8 NativeAOT crash on transaction finish. (#2943)
API breaking Changes
Changed APIs
- Rename iOS and MacCatalyst platform specific options from
CocoatoNative(#2940) - Rename iOS platform specific options
EnableCocoaSdkTracingtoEnableTracing(#2940) - Rename Android platform specific options from
AndroidtoNative(#2940) - Rename Android platform specific options
EnableAndroidSdkTracingandEnableAndroidSdkBeforeSendtoEnableTracingandEnableBeforeSendrespectively (#2940)
Dependencies
4.0.0-beta.3
Fixes
- Reworked automatic breadcrumb creation for MAUI. (#2900)
- The SDK no longer uses on reflection to bind to all public element events. This also fixes issues where the SDK would consume third-party events.
- Added
CreateElementEventsBreadcrumbsto the SentryMauiOptions to allow users to opt-in automatic breadcrumb creation forBindingContextChanged,ChildAdded,ChildRemovedandParentChangedonElement. - Reduced amount of automatic breadcrumbs by limiting the amount of bindings created in
VisualElement,Window,Shell,PageandButton.
- Fixed Sentry SDK has not been initialised when using ASP.NET Core, Serilog and OpenTelemetry (#2911)
Features
- Native crash reporting on NativeAOT published apps (Windows, Linux, macOS). (#2887)
- Android: By default attaches LogCat logs to unhandled exceptions. Configurable via
SentryOptions.Android.LogCatIntegrationandSentryOptions.Android.LogCatMaxLines. Available when targetingnet7.0-androidor later, on API level 23 or later. (#2926)
API breaking Changes
Removed APIs
- SentrySinkExtensions.ConfigureSentrySerilogOptions is now internal. If you were using this method, please use one of the
SentrySinkExtensions.Sentryextension methods instead. (#2902)
Changed APIs
AssemblyExtensionshave been made public again. (#2917)- Rename iOS and MacCatalyst platform specific options from
iOStoCocoa(#2929)