CoreSystem.Resilience 2.0.0

dotnet add package CoreSystem.Resilience --version 2.0.0
                    
NuGet\Install-Package CoreSystem.Resilience -Version 2.0.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="CoreSystem.Resilience" Version="2.0.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="CoreSystem.Resilience" Version="2.0.0" />
                    
Directory.Packages.props
<PackageReference Include="CoreSystem.Resilience" />
                    
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 CoreSystem.Resilience --version 2.0.0
                    
#r "nuget: CoreSystem.Resilience, 2.0.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 CoreSystem.Resilience@2.0.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=CoreSystem.Resilience&version=2.0.0
                    
Install as a Cake Addin
#tool nuget:?package=CoreSystem.Resilience&version=2.0.0
                    
Install as a Cake Tool

⚡ CoreSystem.Resilience

Production-ready resilience framework for .NET 8

CoreSystem.Resilience provides a clean abstraction over resilience strategies for .NET applications. It enables applications to define named resilience pipelines while keeping application code independent from the underlying Polly implementation.

NuGet Downloads License .NET


✨ Features

  • ✅ Retry strategy
  • ✅ Circuit Breaker strategy
  • ✅ Timeout strategy
  • ✅ Named resilience pipelines
  • ✅ Dependency Injection integration
  • ✅ Polly abstraction
  • ✅ Built-in metrics
  • ✅ OpenTelemetry compatible
  • ✅ Configurable handled exceptions
  • ✅ Strongly typed configuration

📦 Installation

dotnet add package CoreSystem.Resilience

🚀 Quick Start

Register the framework:

builder.Services.AddCoreResilience(options =>
{
    options.AddPipeline(PipelineType.Redis, pipeline =>
    {
        pipeline.Retry = new RetryOptions
        {
            MaxRetryAttempts = 3
        };

        pipeline.Timeout = new TimeoutOptions
        {
            Timeout = TimeSpan.FromSeconds(2)
        };

        pipeline.CircuitBreaker = new CircuitBreakerOptions
        {
            FailureRatio = 0.5
        };
    });
});

Resolve a pipeline:

public sealed class RedisService(
    IResiliencePipelineProvider provider)
{
    private readonly IResiliencePipeline _pipeline =
        provider.GetPipeline(PipelineType.Redis);
}

Execute an operation:

await _pipeline.ExecuteAsync(async ct =>
{
    await redis.GetAsync(key, ct);
});

🛡 Supported Strategies

Strategy Description
Retry Retries handled exceptions according to the configured retry options.
Circuit Breaker Opens the circuit when the configured failure conditions are reached.
Timeout Limits the execution time of an operation.

The execution pipeline applies configured strategies in the following order:

Timeout → Retry → Circuit Breaker

Only strategies configured for a pipeline are added to its execution pipeline.


📊 Built-in Metrics

CoreSystem.Resilience publishes metrics using System.Diagnostics.Metrics.

The Core.Resilience meter is registered for OpenTelemetry integration.

Metric Description
core.resilience.retry.attempts Total retry attempts executed by the retry strategy.
core.resilience.timeout.triggered Total operations that exceeded the configured timeout.
core.resilience.circuit.opened Total circuit breaker transitions to Open.
core.resilience.circuit.half_opened Total circuit breaker transitions to Half-Open.
core.resilience.circuit.closed Total circuit breaker transitions to Closed.
core.resilience.pipeline.duration Execution time of the resilience pipeline.

Register the meter with OpenTelemetry:

builder.Services
    .AddOpenTelemetry()
    .WithMetrics(metrics =>
    {
        metrics.AddMeter("Core.Resilience");
    });

🏗 Architecture

Application
      │
      ▼
IResiliencePipelineProvider
      │
      ▼
PipelineRegistry
      │
      ▼
IResiliencePipeline
      │
      ├── Timeout
      ├── Retry
      ├── Circuit Breaker
      │
      ▼
Polly ResiliencePipeline
      │
      ▼
Protected Operation

Each configured PipelineType is registered in the pipeline registry and resolved through IResiliencePipelineProvider. The public abstraction exposes pipeline execution without requiring application code to depend directly on Polly.


📖 Documentation

The full documentation includes:

  • Getting Started
  • Configuration
  • Retry
  • Circuit Breaker
  • Timeout
  • Metrics
  • Architecture
  • Extensibility

Visit the GitHub repository for the complete documentation.


🤝 Contributing

Issues, discussions and pull requests are welcome.


📄 License

Released under the MIT License.

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 was computed.  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 (3)

Showing the top 3 NuGet packages that depend on CoreSystem.Resilience:

Package Downloads
CoreSystem.Cache

Production-ready cache abstraction for .NET 8 with In-Memory caching, extensible external storage, tag-based invalidation, HTTP response caching, and OpenTelemetry metrics.

CoreSystem.Cache.Rehydration

Cache recovery component for CoreSystem.Cache on .NET 8 that restores tracked memory fallback entries to the primary cache provider after recovery.

CoreSystem.Cache.Redis

Redis external cache provider for CoreSystem.Cache on .NET 8, with tag-based invalidation, distributed locking, health checks, and optional resilience integration.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
2.0.0 167 8/16/2026
1.0.4 211 8/2/2026
1.0.3 111 7/24/2026
1.0.2 101 7/23/2026
1.0.1 96 7/21/2026
1.0.0 104 7/21/2026

Resilience pipelines with Retry, Timeout, Circuit Breaker, Dependency Injection, and OpenTelemetry metrics.