Skip to content

docs(dotnet): Document startup crashes in the 7.x migration guide - #20408

Merged
ric-oliv merged 2 commits into
masterfrom
docs/dotnet-v7-startup-crashes
Nov 4, 2026
Merged

ric-oliv merged 2 commits into
masterfrom
docs/dotnet-v7-startup-crashes

Conversation

@ric-oliv

@ric-oliv ric-oliv commented Nov 3, 2026 •

Copy link
Copy Markdown
Member

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 UseSentry used to send crashes from before UseSentry started 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.Init at the top of Main as well, and capture the crash in a catch. Without the catch, an app with an async Main still drops the crash, because using disposes 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 UseSentry but before Run(): with the catch, a sync and an async Main each 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 only UseSentry drops 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-DD with the due date. You can update this information later by editing the PR description.

  • Urgent deadline (GA date, etc.): 2026-11-30
  • Other deadline: YYYY-MM-DD
  • No deadline: Not urgent, can wait up to 1 week+

PRE-MERGE CHECKLIST

Make sure you've checked the following before merging your changes:

  • Checked Vercel preview for correctness, including links
  • PR was reviewed and approved by any necessary SMEs (subject matter experts)
  • PR was reviewed and approved by a member of the Sentry docs team

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>
@vercel

vercel Bot commented Nov 3, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
sentry-docs Ready Ready Preview Nov 4, 2026 9:36am UTC
1 Skipped Deployment
Project Deployment Actions Updated
develop-docs Ignored Ignored Preview Nov 4, 2026 9:36am UTC

Request Review

@coolguyzone coolguyzone left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@codeowner-assignment
codeowner-assignment Bot requested a review from a team November 4, 2026 09:29
@ric-oliv
ric-oliv merged commit deb3b3f into master Nov 4, 2026
34 of 36 checks passed
@ric-oliv
ric-oliv deleted the docs/dotnet-v7-startup-crashes branch November 4, 2026 12:25

This branch was successfully deployed

1 active deployment
Preview – sentry-docs — 13d5e496 Deployed Nov 4, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Priority: Urgent Docs review is needed immediately for an urgent deadline

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants