NResilience.AspNetCore 0.33.0

dotnet add package NResilience.AspNetCore --version 0.33.0
                    
NuGet\Install-Package NResilience.AspNetCore -Version 0.33.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="NResilience.AspNetCore" Version="0.33.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="NResilience.AspNetCore" Version="0.33.0" />
                    
Directory.Packages.props
<PackageReference Include="NResilience.AspNetCore" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add NResilience.AspNetCore --version 0.33.0
                    
#r "nuget: NResilience.AspNetCore, 0.33.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package NResilience.AspNetCore@0.33.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=NResilience.AspNetCore&version=0.33.0
                    
Install as a Cake Addin
#tool nuget:?package=NResilience.AspNetCore&version=0.33.0
                    
Install as a Cake Tool

NResilience.AspNetCore

The ASP.NET Core integration for NResilience.

Install

Install the package using the .NET CLI:

dotnet add package NResilience.AspNetCore

What it adds

Deadline and criticality propagation (inbound half)

One middleware pass that reads what the caller propagated and publishes it for the rest of the request: the deadline, so any policy configured with UseAmbientDeadline = true is bounded by min(its own deadline, the time the caller is still waiting), and how much the work matters, so any policy configured with UseAmbientCriticality = true stops hedging a backfill and stops spending a depleted retry budget on one.

var app = builder.Build();

app.UseResilienceDeadline();

The outbound halves - writing the headers on the way out - are in the core package, on HttpResilienceOptions.PropagateDeadline and HttpResilienceOptions.PropagateCriticality. ReadCriticality turns the second half of the pass off, and RejectExpired refuses a request that arrives with less time left than the Reserve says answering costs.

Nested-retry propagation

Middleware that reads the marker a retrying caller sent (X-NResilience-Retrying: 1), so the outbound handler knows its call is itself a retry and stops retrying it. Without it, a retry that meets a retry multiplies the attempt count - one caller failure becomes many downstream calls.

app.UseResilienceNestedRetry();

The outbound half - writing the marker on the way out - is in the core package, on HttpResilienceOptions.DetectNestedRetries. See nested retries for both halves.

Exception-to-response mapping

An IExceptionHandler, registered in DI rather than positioned in a pipeline, that maps the exceptions NResilience throws to the HTTP responses they mean: DeadlineExceededException to 504, CallRejectedException and RateLimitedException to 503, the latter two with Retry-After when the policy had a hint. Unhandled exceptions fall through to the application's own handlers.

builder.Services.AddResilienceExceptionHandler();
builder.Services.AddProblemDetails();
// ...

app.UseExceptionHandler();

AddProblemDetails() is required by the parameterless UseExceptionHandler() overload; call it after AddResilienceExceptionHandler(). See error responses.

Why it is a separate package

It is the only part of NResilience that requires ASP.NET Core. A worker or a console app must be able to use NResilience.Extensions without it.

Documentation

See deadline propagation and criticality for both halves of each, nested retries for the retry-rejection marker, and the cancellation deep dive for what an inherited deadline costs and why it is opt-in.

Product Compatible and additional computed target framework versions.
.NET net8.0 is compatible.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed.  net9.0 was computed.  net9.0-android was computed.  net9.0-browser was computed.  net9.0-ios was computed.  net9.0-maccatalyst was computed.  net9.0-macos was computed.  net9.0-tvos was computed.  net9.0-windows was computed.  net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.33.0 0 9/23/2026
0.32.0 88 9/10/2026
0.31.0 94 9/9/2026
0.30.0 101 9/9/2026
0.29.0 103 9/9/2026
0.28.0 98 9/9/2026
0.27.0 100 9/9/2026
0.26.0 100 9/8/2026
0.25.0 96 9/8/2026
0.24.0 94 9/8/2026
0.23.0 97 9/5/2026
0.22.0 109 9/5/2026
0.21.0 97 9/3/2026
0.20.0 93 9/3/2026
0.19.0 93 9/3/2026
0.18.0 93 9/1/2026
0.17.0 102 9/1/2026
0.16.0 93 9/1/2026
0.15.0 92 9/1/2026
0.14.0 193 8/30/2026
Loading failed