Repository navigation
Version 7.0.0 of the Sentry SDK for .NET 🎉 #5948
jamescrosswell
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Hey everyone! We've just released version 7.0.0 of the Sentry SDK for .NET 🎉
The headline changes are .NET 11 support and a single place to initialize Sentry. This is a major release with breaking changes, so please read the migration guide before you upgrade. There's also an interactive checklist that saves your progress, and both pages include a prompt you can hand to a coding agent.
For the full story, see the blog post: Sentry's .NET SDK 7.0 is ready for .NET 11
New Features
.NET 11 support. The SDK targets
net11.0alongside .NET 8, 9 and 10, including Android, iOS and Mac Catalyst. It reads .NET 11's Android assembly stores and Zstandard-compressed assemblies, so Android stack traces keep their file names and line numbers. (#5902, #5577, #5575)UseSentry()for worker services and Azure Functions. The newSentry.Extensions.Hostingpackage addsUseSentry()toHost.CreateApplicationBuilderandIHostBuilder. It works for worker services, console apps, Azure Functions (isolated) and Windows services. (#5739)Breaking Changes
net9.0-android,net9.0-ios,net9.0-maccatalystandnet9.0-windowshave been dropped. On .NET 11 the minimum Android API level is 24 and the minimum Mac Catalyst version is 17.0. Other targets are unchanged: .NET 8+, .NET Standard 2.0/2.1 and .NET Framework 4.6.2. (#5529)Microsoft.Extensions.Loggingintegrations no longer start the SDK. They only capture logs, breadcrumbs and events. Initialize Sentry once, withSentrySdk.InitorUseSentry(). A DSN still set on a logging integration fails with a message that explains what to change. This also fixes apps that called bothUseSentry()andLogging.AddSentry()and so captured every error twice. (#5573, #5585, #5592, #5595, #5694)SentryOptions.EnableLogsis removed. Adding a logging integration is now the opt-in. ASP.NET Core, MAUI and Blazor WebAssembly keepEnableLogson their own options.SetBeforeSendLogto filter. (#5642)SentryOptions.EnableMetricsis removed. It has had no effect since 6.10.0. (#5690)ISentryBuilderapps now report the host environment, such asdevelopmentorstaging, instead ofproductionwhen no environment is set. Check any alerts or filters that match onproduction. (#5703)API Changes
Logging:Sentryinappsettings.jsonnow only sets log levels (MinimumEventLevel,MinimumBreadcrumbLeveland theLogLevelrules). Any other key must move to theSentrysection, and the app fails at startup until it does. (#5595)SentryLoggingOptions,SentrySerilogOptionsandSentryNLogOptionsno longer derive fromSentryOptions. Serilog'sApplySerilogScopeToEvents()is renamedUseSerilog().ILoggerFactory.AddSentry(): Removed. UseILoggingBuilder.AddSentry()instead, for exampleLoggerFactory.Create(builder => builder.AddSentry()). (#5921)Logging.AddSentry()no longer registersIHub,ISentryClientorFunc<IHub>in the service collection;UseSentrydoes. Apps that initialize Sentry withSentrySdk.Initand inject these types should switch toUseSentry, or registerHubAdapter.Instancethemselves. (#5740)Scope.Release,Scope.DistributionandSentryOptions.ApplyDefaultTagsare removed. SetReleaseandDistributiononSentryOptions.DefaultTagsare still applied. (#5671)SentryOptions.ScopeObserver,EnableScopeSyncandCrashedLastRunare now internal. (#5631)SentryOptions.Native.EnableAppHangTrackingV2is removed (useEnableAppHangTracking), as isSentryOptions.Native.AddInAppExclude(string), which had no effect. (#5654)Envelope.FromEvent,Envelope.FromFeedbackandEnvelope.FromTransactionnow take theIDiagnosticLoggeras their last parameter. This only affects code that creates envelopes directly and passes arguments positionally. (#5669)SentryClientExtensions.GetInternalSentryOptionsis removed. Use the newGetDiagnosticLogger()extension onIHub, inSentry.Extensibility. (#5862)defaultTextMapPropagatorparameter is removed. Configure the propagator through the OpenTelemetry SDK instead. (#5319)"critical"breadcrumb level is no longer deserialized. (#5630)Behavior Changes
UseSentrycallback now overrideappsettings.json, as they do in ASP.NET Core. (#5658)SentryOptions.DecompressionMethodsnow defaults toGZip | Deflate. To accept Brotli responses again, setoptions.DecompressionMethods |= DecompressionMethods.Brotli. (#5816)Infoand above are sent as logs. LowerMinimumLogLevelto sendTraceandDebugentries too. NLog now flushes usingSentryOptions.FlushTimeout, which defaults to 2 seconds (it used to wait up to 15). (#5913)LogContextproperties to events as tags, even when the app doesn't callUseSerilog().sentry.dotnet.aspnetcore, rather than the logging integration that captured them. (#5671)SENTRY_RELEASEnow takes precedence over the release derived from the app package. (#5671)For the full list of changes, see the CHANGELOG.
Upgrading
Update every Sentry package to 7.0.0 at the same time, then work through the migration guide. If you run into problems, please open an issue.
We'd love your feedback! Let us know what you think of the new features here, and tell us about any problems or suggestions.
Thanks for being part of the community and helping us make Sentry better!
All reactions