Microsoft.Extensions.Resilience (10.8.0)
Published 2026-09-09 02:38:32 +03:30 by kayer
Installation
dotnet nuget add source --name kayer --username your_username --password your_token dotnet add package --source kayer --version 10.8.0 Microsoft.Extensions.ResilienceAbout this package
Extensions to the Polly libraries to enrich telemetry with metadata and exception summaries.
Microsoft.Extensions.Resilience
Extensions to the Polly libraries to enrich telemetry with metadata and exception summaries.
Install the package
From the command-line:
dotnet add package Microsoft.Extensions.Resilience
Or directly in the C# project file:
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Resilience" Version="[CURRENTVERSION]" />
</ItemGroup>
Usage Examples
The services can be registered using the following method:
public static IServiceCollection AddResilienceEnricher(this IServiceCollection services)
This will optionally consume the IExceptionSummarizer service if it has been registered and add that data to Polly's telemetry. It will also include RequestMetadata that can be set or retrieved with these extensions:
public static void SetRequestMetadata(this ResilienceContext context, RequestMetadata requestMetadata)
public static RequestMetadata? GetRequestMetadata(this ResilienceContext context)
See the Polly docs for details about working with ResilienceContext.
Feedback & Contributing
We welcome feedback and contributions in our GitHub repo.