Verify every ASP.NET Core deploy in production
DeployAngel compares each ASP.NET Core release with your last healthy one, using real production traffic: error rate, p95 latency, exceptions, and Hangfire jobs, app-wide and per endpoint and job. Then it clears the release or fails it, with the evidence, and tells you, your CI, or your coding agent when it's safe to stop watching. Setup is one package, one line in Program.cs, and one environment variable.
Requires .NET 8 or later, for ASP.NET Core apps and worker services. The package has no dependencies beyond the .NET and ASP.NET Core shared frameworks.
1. Install the agent
Create an account and an app, then create its app token from the setup checklist. Then add the agent:
Add the package:
dotnet add package DeployAngel
and register it where the host is built:
// Program.cs builder.Services.AddDeployAngel();
That's all for a web app. The agent puts its middleware first in the pipeline, records every request and unhandled exception (including ones your exception handler renders as an error page), and sends the minute in progress when the host stops. It reports when the host's environment is Production.
For Hangfire 1.8 or later, add DeployAngel.Hangfire and call UseDeployAngel() in every process that runs Hangfire:
dotnet add package DeployAngel.Hangfire
builder.Services.AddHangfire(config => config
.UseDeployAngel()
.UsePostgreSqlStorage(...));
Keep the debug symbols (.pdb files) that dotnet publish writes next to your assemblies, which it does by default. The agent reads them to tell which source file each exception, route, and job is in, without your source code being deployed or sent.
2. Set the token
Set the app token as DEPLOYANGEL_TOKEN in production, on every process: web servers and job workers alike. On Heroku, the DeployAngel add-on sets it for you.
The agent finds the release it's running by itself on Heroku (with dyno metadata enabled), Kamal, Render, Fly.io, Railway, Coolify, Dokku, ECS, and servers deployed from a git checkout. When the app is built in a git checkout, the .NET SDK writes the commit into the assembly's version, and the agent reads it from there. A Docker build whose context leaves out .git doesn't have it, so bake the commit in: deployangel install docker adds ARG GIT_SHA and ENV DEPLOYANGEL_REVISION=$GIT_SHA to your Dockerfile, and you build with --build-arg GIT_SHA=$(git rev-parse HEAD). Set it up for how you deploy has the steps for each host.
3. Check the setup
Once it's deployed, run:
deployangel doctor
It checks your checkout and what DeployAngel has seen so far: which processes report and the release each runs, the routes, jobs, and scheduled jobs the agent found, and any setup problem, such as a worker that isn't running the agent, with what to do about it. Install the command once with dotnet tool install --global DeployAngel.Tool.
The first day is a warm-up. For an app's first 24 hours of telemetry, DeployAngel learns what's normal for it. Deploys during that time are still checked, and you'll hear right away if one fails, but they can't be cleared. Installing the agent a day before a deploy you care about means that deploy can be cleared.
What the ASP.NET Core agent records
- Every request, by its endpoint's route template (
GET /orders/{id}), never the raw path: counts, status codes, and latency. - Exceptions: a fingerprint, the class, application frames (or the first library frames when none is the app's), and the first line of the message with numbers, IDs, emails, UUIDs, and quoted values replaced.
- Hangfire jobs, named as Hangfire names them (
Shop.Jobs.InvoiceJob.Send): every attempt, its duration, and whether it threw. A job whose retries run out counts as discarded. - Hangfire's recurring jobs, read from its storage with their cron schedules and time zones, so DeployAngel expects each one and notices when one stops running. Cron jobs and
BackgroundServiceloops can be declared. - Health checks aren't counted, because they make an app look busier and healthier than its real pages:
MapHealthChecksendpoints wherever they're mounted, and any route at a conventional path such as/healthz. - Never sent: request bodies, parameters, headers, cookies, SQL, logs, or source code. Recording only updates counters in memory, and one payload a minute goes out in the background.
The privacy policy lists exactly what's collected. If DeployAngel is ever unreachable, your app keeps running normally, and the agent sends up to an hour of telemetry once it's back.
4. Wait for the verdict in CI or a coding agent
Each release is compared with your last healthy one for at least 15 minutes. A busy app usually clears in about that time; a quiet one can take longer, or run a smoke test after each deploy. With a "CI deploys" or "CLI & coding agents" token in DEPLOYANGEL_API_TOKEN, the CLI waits for the verdict and exits with a code a pipeline can act on:
deployangel verify --wait --until=initial
- 0 cleared, 1 failed, 2 not cleared
- 6 no problems in the first 15 minutes, but not cleared yet
- 3 still verifying when the wait timed out
To give Claude Code, Cursor, and Codex the same verdicts through DeployAngel's read-only MCP server, run this in the project:
deployangel install agents
The CLI reference lists every command and exit code, and set up your coding agent covers the MCP server.
ASP.NET Core troubleshooting
Start with deployangel doctor: it names most setup problems and what to do about each.
The app page says "Agent hasn't reported yet"
Check that AddDeployAngel() runs where the host is built, that DEPLOYANGEL_TOKEN is set on every process, and that the app can reach https://api.deployangel.com. The agent reports only from the environments it lists, production by default, named after the host's environment in lowercase. DEPLOYANGEL_ENABLED=true forces it on.
Report from staging
Add staging as an environment of the same app in the dashboard, give that deployment staging's token, and list it:
builder.Services.AddDeployAngel(options =>
{
options.Environments = new[] { "production", "staging" };
});
Exceptions are named by method, not file
The .pdb files weren't deployed. Keep them next to your assemblies (dotnet publish writes them by default). Without them the agent can't tie exceptions, routes, and jobs to source files, and, with no commit to go on, can't tell which release it's running.
A worker service fails to start in Docker
The package uses the ASP.NET Core shared framework, so a worker service that adds it runs on the ASP.NET Core runtime. Build it on the mcr.microsoft.com/dotnet/aspnet images rather than runtime.
My health check is somewhere else
List its route the way the dashboard shows it, and HEAD requests to it are left out too:
builder.Services.AddDeployAngel(options =>
{
options.IgnoredRoutes.Add("GET /status");
});
A release failed on 500s from bad form posts
Scanners post form bodies that can't be parsed. Bound forms ([FromForm], IFormCollection, MVC model binding) answer them with a 400, but Request.ReadFormAsync() and Request.Form throw, and the request becomes a 500 that can fail a release that didn't cause it. Bind the form, or see requests that become 500s for a few lines that answer 400.
"Not cleared: this release never reported"
No process reported the registered release within 15 minutes. If another release kept running, the rollout failed or was rolled back. Otherwise the new version may never have started (check the boot logs, for example for a failed migration), or CI registered a different commit from the one the app runs. Register the commit that was built and deployed, after the deploy finishes.
More
- The full docs: each host, registering deploys from CI, staging, webhooks, PagerDuty, Honeybadger, and AppSignal, GitHub, and configuration
- The agent is open source: source and README on GitHub, and NuGet
- Setup guides for other frameworks: Rails, Django, FastAPI, Flask
Still stuck? Contact us.