Platforms.NET

.NET

Capture exceptions from ASP.NET Core and .NET workers with the Sentry NuGet package pointed at Epure.

Use the official Sentry NuGet package (fixture captured at 4.9.0). Point Dsn at your Epure host. No Epure NuGet package.

Use this guide when the process is .NET: ASP.NET Core, Minimal APIs, workers / HostedService. Do not use this for JS/TS (→ Next.js). Full map: Pick your SDK.

Capture exceptions in .NET

dotnet add package Sentry, call SentrySdk.Init (or UseSentry on the web host) once at startup, then throw or CaptureException. Envelope ingest. Grouping uses raw frames.

How do I install the Sentry SDK?

dotnet add package Sentry

For ASP.NET Core, keep Sentry.AspNetCore if you already call UseSentry. Only the DSN host changes.

Init the .NET SDK

SentrySdk.Init(options =>
{
    options.Dsn = Environment.GetEnvironmentVariable("SENTRY_DSN");
    options.Environment = "local";
    options.Release = "my-api@0.0.0";
    options.TracesSampleRate = 0.0;
    options.ProfilesSampleRate = 0.0;
});

Local compose DSN shape:

http://YOUR_PUBLIC_KEY@localhost:8080/YOUR_PROJECT_ID
OptionValue
DsnRequired: public key + Epure host + project UUID
EnvironmentTag for the dashboard filter strip
ReleaseVersion string on the issue
TracesSampleRate0; transactions discarded
ProfilesSampleRate0; profiles discarded

UseSentry / SentryAspNetCore stay. Unhandled HTTP exceptions still post envelopes after the DSN swap. Background services need init in the worker host, not only Program.cs for the web app.

How do I capture handled errors?

try
{
    Risky();
}
catch (Exception e)
{
    SentrySdk.CaptureException(e);
    throw;
}

What should I see after ingest?

202, then an issue whose title matches the exception type and message, with a stack as the SDK sent it.

Why does .NET never send?

What you seeWhat to do
401 / 403Recopy the DSN from Settings → SDK connection
202, empty IssuesMatch the environment chip to options.Environment
Worker throws missingInit Sentry in the worker host

Next

Does Epure demangle .NET stacks?

No extra symbol server beyond what the SDK embeds. Grouping uses frames as sent. Confirm with Verify.

Are traces stored?

No. Set TracesSampleRate and ProfilesSampleRate to 0. Those item types are discarded on ingest. Exception events plus breadcrumbs stay.