Repository navigation
Write the 7.x section of the .NET migration guide #5710
Copy link
Copy link
Open
Labels
.NETPull requests that update .net codePull requests that update .net codeDocsNext MajorChanges scheduled for the next Major release.Changes scheduled for the next Major release.
Description
The 7.0 project's Definition of Done requires a migration guide on docs.sentry.io that covers every breaking change, with the code a 6.x user has to change. docs/platforms/dotnet/common/migration/index.mdx in getsentry/sentry-docs has no 7.x section yet. #5698, #5700 and #5632 all point at it, but no issue owns it.
Several PR descriptions already have before/after snippets that can be copied: #5573 (Serilog), #5585 (NLog), #5592 (log4net), #5595 (Microsoft.Extensions.Logging), #5632 (TraceIgnoreStatusCodes) and #5669 (Envelope).
The section should merge when 7.0.0 ships. Before it does, check git log origin/main..origin/version7 for anything merged after this issue was written.
Entries
Target frameworks
- .NET 11 is supported (#5529, feat: add support for .NET 11 RC 1 #5566). Mobile targets (
-android,-ios,-maccatalyst,-windows) move tonet10.0andnet11.0, so thenet9.0mobile targets are dropped. Non-mobile targets keepnet8.0andnet9.0and addnet11.0. - On
net11.0, the minimum Android API level rises from 21 to 24 and the minimum Mac Catalyst version from 15.0 to 17.0. Apps onnet10.0are unaffected.
Logging integrations no longer initialize the SDK (#5245)
Details are in #5706.
- Serilog, NLog, log4net and Microsoft.Extensions.Logging need Sentry initialized first, with
SentrySdk.InitorUseSentry. The old DSN entry points fail with a migration message. - Serilog:
ApplySerilogScopeToEvents()is nowUseSerilog(), andLog.CloseAndFlush()no longer disposes the SDK. Dispose the handle thatSentrySdk.Initreturns instead. - NLog: the
dsn,release,environment,initializeSdk,shutdownTimeoutSecondsandflushTimeoutSecondsattributes are gone, and the flush timeout is nowSentryOptions.FlushTimeout(2 seconds instead of 15). - log4net:
Environmentis gone, and closing the repository no longer flushes Sentry. - Microsoft.Extensions.Logging:
Logging:Sentryaccepts only logging settings,SentryLoggingOptionsno longer derives fromSentryOptions, the host options derive from the newSentryHostOptions, andAddSentry<TOptions>requiresTOptions : SentryHostOptions. - Generic-host apps initialize Sentry with the API from Add a non-logging way to initialise Sentry in generic host apps #5572 (docs in Document how to initialize Sentry in generic host apps for v7.0.0 #5707).
- When replacing
Logging.AddSentry()withUseSentry, keepUseSentryafterClearProviders(). In 6.x both were calls on the logging builder, and the usual order putClearProviders()first.UseSentrygoes on the host builder, so it's easy to call it first. ThenClearProviders()removes Sentry'sILoggerintegration without an error or a warning. See #5755.
- When replacing
Logs and metrics
SentryOptions.EnableLogsis removed (feat!: EnableLogs moves from SentryOptions to ASP.NET Core, MAUI and Blazor, where logs are opt-in #5642). It stays on the ASP.NET Core, MAUI and Blazor options. Serilog'senableLogsparameter is removed, and NLog's is obsolete and ignored. Details are in Document the logging changes for v7.0.0 #5698.- An app that calls
UseSentryand alsoLogging.AddSentry()now ignores options passed toLogging.AddSentry()in code (fix!: apps that call both UseSentry and Logging.AddSentry() no longer capture each error, breadcrumb and log twice #5694). Move them to the host's options and remove the call. SentryOptions.EnableMetricsis removed (feat!: remove SentryOptions.EnableMetrics #5690). To drop metrics, returnnullfromSetBeforeSendMetric.
Tracing
TraceIgnoreStatusCodesdefaults to[301, (305, 399), (401, 404)](feat!: don't trace 301, 305-399 or 401-404 responses by default #5632). Details are in Document TraceIgnoreStatusCodes and its new default for v7.0.0 #5708.- The OTLP exporter no longer sets up a propagator, and the
defaultTextMapPropagatorparameter ofAddSentryOtlpExporterandUseOtlpis removed (#5319). Details are in Document changes to OTel propagator for v7.0.0 #5546. - The minimum OpenTelemetry version is 1.12.0 (feat(otel): raise the OpenTelemetry floor to 1.12.0 #5560).
Release, environment and SDK name (#5671)
Details are in #5709.
Scope.ReleaseandScope.Distributionare removed, andReleaseandDistributionmove fromIEventLiketoITransactionData. Set them onSentryOptions, or on an individual event, transaction or check-in.SentryOptions.ApplyDefaultTagsis removed.DefaultTagsare still applied.- An environment set on the scope now applies to logs, metrics, sessions and check-ins too.
sdk.namenames the integration that initialized Sentry, so Serilog and NLog events no longer report their own SDK name, and Blazor WebAssembly reportssentry.dotnet.aspnetcore.blazor.webassembly.- On Android, iOS and Mac Catalyst,
SENTRY_RELEASEtakes precedence over the release derived from the app package. - More apps now report the .NET host environment when they don't set
Environment(feat!: set the Sentry environment from the host environment in every ASP.NET Core UseSentry overload, Blazor WebAssembly and Google Cloud Functions #5703): Blazor WebAssembly, Google Cloud Functions, and apps that use theISentryBuilderoverloads of ASP.NET Core'sUseSentry, which gRPC apps do. They reportdevelopment,stagingor a custom environment name where they used to reportproduction, ordebugwith a debugger attached. Update saved searches and alerts that filter on the old value, or setEnvironment(orSENTRY_ENVIRONMENT) to keep it.
MAUI
- Options set in
UseSentrynow take precedence overappsettings.json(fix(maui)!: options set in UseSentry now take precedence over appsettings.json #5658). The order is theSentryconfiguration section, then theUseSentrycallback, then the settings MAUI forces.
Removed or internal APIs
- iOS and Mac Catalyst:
SentryOptions.Native.EnableAppHangTrackingV2is removed; useEnableAppHangTracking.SentryOptions.Native.AddInAppExclude(string)is removed; it had no effect (feat!: remove obsolete iOS optionsEnableAppHangTrackingV2andAddInAppExclude#5654). SentryOptions.ScopeObserver,EnableScopeSyncandCrashedLastRunare internal (feat!:SentryOptions.ScopeObserver,EnableScopeSyncandCrashedLastRunare now internal #5631). AnEnableScopeSynckey in configuration is ignored.Envelope.FromEvent,FromFeedbackandFromTransactiontake the logger as their last parameter (feat!:Envelope.FromEvent,FromFeedbackandFromTransactionnow take theloggeras their last parameter #5669).- Breadcrumbs with the
"critical"level are no longer read asFatal(feat!: stop deserializing "critical" breadcrumb level #5630). This only affects envelopes cached by 5.x and never sent.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
.NETPull requests that update .net codePull requests that update .net codeDocsNext MajorChanges scheduled for the next Major release.Changes scheduled for the next Major release.
Activity
linear-code commentedon Oct 12, 2026
NET-860
jamescrosswell commentedon Oct 20, 2026
@ric-oliv this might help as a rough start:
#5749