Repository navigation
docs(dotnet): Document startup crashes in the 7.x migration guide - #20408
Merged
Merged
Conversation
In 7.0.0 the Serilog sink, NLog target and log4net appender no longer start Sentry. Apps that set the DSN there and also call UseSentry stop sending crashes from before UseSentry starts Sentry. Add a verify step that shows the early SentrySdk.Init workaround. Refs getsentry/sentry-dotnet#5844 Refs getsentry/sentry-dotnet#5710 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
ric-oliv
marked this pull request as ready for review
November 3, 2026 16:23
coolguyzone
approved these changes
Nov 3, 2026
coolguyzone
left a comment
Contributor
There was a problem hiding this comment.
LGTM, thanks for updating!
The startup crash snippet still dropped the crash when Main is async: the using disposes the first initialization before the exception reaches the runtime, so nothing is left to send it. Wrap startup in a try/catch that calls SentrySdk.CaptureException, as suggested in review, and say so in the lead-in. On 7.0.0-rc.3, with a crash after UseSentry but before Run(), the old snippet sent nothing from an async Main. The new one sends the crash once from a sync and an async Main. Also link the Capturing Startup Crashes sections of the NLog and log4net guides, not only Serilog's, and say that 6.x logging integrations started Sentry themselves. The log4net appender did so on the first log entry, not when log4net was set up. Refs getsentry/sentry-dotnet#5844 Co-authored-by: James Crosswell <jamescrosswell@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This branch was successfully deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
DESCRIBE YOUR PR
In 7.0.0 the Serilog sink, NLog target and log4net appender no longer start Sentry. Apps that set the DSN there and also call
UseSentryused to send crashes from beforeUseSentrystarted Sentry, and now drop them.This adds "Logging Integrations No Longer Report Startup Crashes" to the 6.x to 7.x migration guide, as a verify step in the interactive checklist. It shows the workaround from getsentry/sentry-dotnet#5847: call
SentrySdk.Initat the top ofMainas well, and capture the crash in acatch. Without thecatch, an app with an asyncMainstill drops the crash, becauseusingdisposes the first initialization before the exception reaches the runtime. "Logging Integrations No Longer Initialize Sentry" says to initialize Sentry once, so it now links to the new step.Checked on 7.0.0-rc.3 with a local stand-in for Sentry, crashing after
UseSentrybut beforeRun(): with thecatch, a sync and an asyncMaineach send the crash once. Without it, the async one sends nothing.getsentry/sentry-dotnet#5844 only covers Serilog. On 6.12.1 the NLog target and the log4net appender also sent a crash logged from
Main, and on 7.0.0-rc.2 an NLog app with onlyUseSentrydrops it, so the step covers all three.The links to the "Capturing Startup Crashes" sections of the Serilog, NLog and log4net guides land at the top of each page until #19925 adds them.
Refs getsentry/sentry-dotnet#5844
Refs getsentry/sentry-dotnet#5710
IS YOUR CHANGE URGENT?
Help us prioritize incoming PRs by letting us know when the change needs to go live.
Select exactly one option. For deadlines, replace
YYYY-MM-DDwith the due date. You can update this information later by editing the PR description.PRE-MERGE CHECKLIST
Make sure you've checked the following before merging your changes: