Skip to content

Document the onboarding changes for v7.0.0 and fix the .NET onboarding snippets #5700

Done

Description

@ric-oliv

Companion to #5698. That issue covers the logs pages in sentry-docs. This one covers the in-product onboarding flow, the "Copy for LLMs" markdown it generates, and the matching getting-started pages. Two kinds of work: the 7.0.0 changes that break the current snippets, and problems the snippets have had since long before 7.0.0.

The in-product onboarding lives in getsentry/sentry, not in sentry-docs, under static/app/gettingStartedDocs/dotnet*/. It has one folder per platform: dotnet, dotnet-aspnetcore, dotnet-aspnet, dotnet-awslambda, dotnet-gcpfunctions, dotnet-maui, dotnet-winforms, dotnet-wpf, dotnet-xamarin. The logs and metrics verify steps are shared from dotnet/logs.tsx and dotnet/metrics.tsx.

Found while going through the ASP.NET Core onboarding flow on sentry.io against a fresh dotnet new web app on 2026-10-11. Every API claim below was checked against the 6.12.0 tag and the version7 branch of sentry-dotnet.

What breaks in 7.0.0

  • SentryOptions.EnableLogs is removed (feat!: EnableLogs moves from SentryOptions to ASP.NET Core, MAUI and Blazor, where logs are opt-in #5642). The onboarding sets options.EnableLogs = true inside SentrySdk.Init for dotnet, dotnet-aspnet, dotnet-winforms and dotnet-wpf, and dotnet/logs.tsx does the same in its configure step. Those snippets stop compiling on 7.0.0. Remove the line and the sentence "To enable logging, you need to initialize the SDK with the EnableLogs option set to true." SentrySdk.Logger never needed the option.
  • dotnet-aspnetcore, dotnet-awslambda, dotnet-gcpfunctions and dotnet-maui set EnableLogs on the host options (SentryAspNetCoreOptions, SentryMauiOptions), which still exist in 7.0.0. Those stay, but the comment "Enable logs to be sent to Sentry" should say what the flag does: it forwards ILogger output to Sentry Logs. It has no effect on SentrySdk.Logger.
  • The logs verify step then sends SentrySdk.Logger.LogInfo(...), which arrives whether EnableLogs is on or off. As a verification of the flag it proves nothing. For the host platforms, verify with an ILogger call instead, for example app.Logger.LogInformation(...).
  • The migration guide at docs/platforms/dotnet/common/migration/index.mdx needs a 7.x section. Document the logging changes for v7.0.0 #5698 lists the logging entries; add whatever else 7.0.0 removes that an onboarding snippet used to show.

Wrong or stale today, regardless of version

  • The ASP.NET Core configure snippet is the pre-.NET 6 template: CreateHostBuilder plus Host.CreateDefaultBuilder(args).ConfigureWebHostDefaults(...). Every template since .NET 6 is minimal hosting: var builder = WebApplication.CreateBuilder(args); followed by builder.WebHost.UseSentry(o => ...). A newcomer gets a method with no class to put it in. Show the WebApplication form first, as the docs page already does, and keep the generic-host form as a second tab at most.
  • When the WebApplication form is shown, keep builder.WebHost.UseSentry(...) and var app = builder.Build(); as two statements. UseSentry returns the IWebHostBuilder, so chaining .Build() onto it calls IWebHostBuilder.Build(). On .NET 10 and later that is obsolete (ASPDEPR008), the result is an IWebHost with no MapGet, and ConfigureWebHostBuilder.Build() throws NotSupportedException at runtime. A first-time user trying to fit the call into the template's fluent chain hits exactly this.
  • The Tracing section says "You can measure the performance of your endpoints by adding a middleware to Startup.cs:" and then shows nothing. There is no Startup.cs in a minimal-hosting app, and no middleware to add. UseSentry registers the middleware and TracesSampleRate turns transactions on. Replace the sentence with that statement.
  • The HomeController span sample does not compile. Person returns IActionResult but the try block has no return, so the compiler reports CS0161. It is also an MVC controller, and the template the user most likely has is a minimal API with no AddControllers. Show a MapGet lambda that takes IHub as a parameter. MapGet works unchanged on every current template (web, webapi, mvc, razor, blazor) because they all build a WebApplication, and controllers and minimal API endpoints share one routing table, so it is the form that serves the whole "ASP.NET Core" page. Keep the controller version as a second tab at most, compiling, and labeled as MVC. Drop the unused using Microsoft.Extensions.Logging;.
  • "If you don't want to depend on the static class, the SDK registers a client in the DI container. In this case, you can take IHub as a dependency." links to the unit-testing page. Link to a page that shows injection, or explain it inline.
  • The two F# sample links point at sentry-demos/fsharp (last push May 2023) and sentry-demos/giraffe (last push February 2021). Both predate the 4.x line. Drop them or refresh them.
  • Fallback package versions in getPackageVersion are 3.34.0 for dotnet-aspnet, dotnet-awslambda, dotnet-gcpfunctions, dotnet-winforms and dotnet-wpf, and 1.5.2 for dotnet-xamarin. They only show when the release registry is unreachable, but they should move to the current major.

Things the flow does not say that a first-time user needs

  • Where to put SentrySdk.CaptureMessage("Hello Sentry"). In a minimal-hosting app anything after builder.Build() works, an endpoint is the realistic place.
  • Release and environment. The SDK infers the release from the entry assembly version and ASP.NET Core sets the environment from the hosting environment name. The user sees development on the first event without being told why.
  • SendDefaultPii is not mentioned, so the first events carry no user or IP. Say so, and point at the option.
  • appsettings.json binding is not mentioned at all, although the docs page leads with it. One sentence and a link is enough.
  • Debug = true with the default DiagnosticLevel of Debug prints every envelope to the console. Say that it is for the first run and should come off afterwards.

Where the changes go

  • getsentry/sentry: static/app/gettingStartedDocs/dotnet-aspnetcore/onboarding.tsx for the configure, tracing and samples fixes; dotnet/onboarding.tsx, dotnet-aspnet, dotnet-winforms, dotnet-wpf and dotnet/logs.tsx for the EnableLogs removal; every dotnet*/onboarding.tsx for the fallback versions. The onboarding.spec.tsx files next to them assert on the rendered snippets and will need updating.
  • getsentry/sentry-docs: docs/platforms/dotnet/guides/aspnetcore/index.mdx already shows the WebApplication form, but check the other platform guides for the same EnableLogs on SentryOptions and for the HomeController sample. docs/platforms/dotnet/common/migration/index.mdx for the 7.x section.

As with #5698, the .NET docs are not versioned. The guiding rule for every snippet on the page: the page is titled "ASP.NET Core", not "ASP.NET Core MVC", so each snippet should work on a fresh dotnet new web app without translation, and where a snippet assumes a hosting model or a framework flavor it should say so. The EnableLogs removals should merge when 7.0.0 ships, or the text should say it applies from 7.0.0 on. The snippet fixes in the second section can ship now.

Activity

  1. linear-code commented on Oct 11, 2026

    @linear-code
  2. added
    .NET
    Next Major
    on Oct 11, 2026
  3. self-assigned this
    on Oct 13, 2026
  4. ric-oliv commented on Oct 13, 2026

    @ric-oliv
    MemberAuthor

    getsentry/sentry#127238 merged. It covers the ASP.NET Core items under "Wrong or stale today":

    • The configure step uses the WebApplication form, with var app = builder.Build(); as its own statement and one sentence on why.
    • The tracing step no longer mentions Startup.cs or middleware. The span example is an app.MapGet endpoint that takes IHub as a parameter.
    • The IHub sentence explains the injection inline, and the unit-testing link now fits it.
    • The verify step shows CaptureMessage between builder.Build() and app.Run().
    • The F# sample links are gone.
    • The ASP.NET Core fallback version went from 4.3.0 to 6.12.1.
    • Found on the way: the shared metrics verify snippet started with using Sentry;, which fails with CS1529 when pasted after builder.Build(). It's removed from the shared snippet.

    This differs from the issue on one point: there is no generic-host tab and no MVC tab. Every snippet works in a fresh dotnet new web app, and MapGet works on every current template. The "Copy for LLMs" markdown is built from the same steps, so it has the changes too.

    Still open:

    • Everything under "What breaks in 7.0.0". It merges when 7.0.0 ships.
    • Fallback versions on the other platforms: 3.34.0 in dotnet-aspnet, dotnet-awslambda, dotnet-gcpfunctions, dotnet-winforms and dotnet-wpf, 1.5.2 in dotnet-xamarin, and 4.3.0 in dotnet-maui, which the list above missed.
    • "Things the flow does not say", except where to put CaptureMessage.
    • The sentry-docs checks on the other platform guides.
  5. added this to the 7.0.0 milestone on Nov 16, 2026
  6. added 20 commits that reference this issue on Nov 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

.NETDocsNext Major

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions