Microsoft.Extensions.Http.Polly 10.0.0-rc.1.25451.107

Prefix Reserved
This is a prerelease version of Microsoft.Extensions.Http.Polly.
dotnet add package Microsoft.Extensions.Http.Polly --version 10.0.0-rc.1.25451.107
                    
NuGet\Install-Package Microsoft.Extensions.Http.Polly -Version 10.0.0-rc.1.25451.107
                    
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="Microsoft.Extensions.Http.Polly" Version="10.0.0-rc.1.25451.107" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Microsoft.Extensions.Http.Polly" Version="10.0.0-rc.1.25451.107" />
                    
Directory.Packages.props
<PackageReference Include="Microsoft.Extensions.Http.Polly" />
                    
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 Microsoft.Extensions.Http.Polly --version 10.0.0-rc.1.25451.107
                    
#r "nuget: Microsoft.Extensions.Http.Polly, 10.0.0-rc.1.25451.107"
                    
#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 Microsoft.Extensions.Http.Polly@10.0.0-rc.1.25451.107
                    
#: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=Microsoft.Extensions.Http.Polly&version=10.0.0-rc.1.25451.107&prerelease
                    
Install as a Cake Addin
#tool nuget:?package=Microsoft.Extensions.Http.Polly&version=10.0.0-rc.1.25451.107&prerelease
                    
Install as a Cake Tool

About

Microsoft.Extensions.Http.Polly integrates IHttpClientFactory with the Polly library to provide comprehensive resilience and transient fault-handling. It allows developers to express policies such as Retry, Circuit Breaker, Timeout, Bulkhead Isolation, and Fallback in a fluent and thread-safe manner.

This package is deprecated. Please use either Microsoft.Extensions.Resilience or Microsoft.Extensions.Http.Resilience instead.

How to Use

To use Microsoft.Extensions.Http.Polly, follow these steps:

Installation

dotnet add package Microsoft.Extensions.Http.Polly

Usage

Handle transient faults

AddTransientHttpErrorPolicy can be used define a policy that handles transient errors:

builder.Services.AddHttpClient("PollyWaitAndRetry")
    .AddTransientHttpErrorPolicy(policyBuilder =>
        policyBuilder.WaitAndRetryAsync(
            retryCount: 3,
            retryNumber => TimeSpan.FromMilliseconds(600)));

In the preceding example, failed requests are retried up to three times with a delay of 600 ms between attempts.

Dynamically select policies

To dynamically inspect a request and decide which policy apply, use the AddPolicyHandler extension method:

var timeoutPolicy = Policy.TimeoutAsync<HttpResponseMessage>(
    TimeSpan.FromSeconds(10));
var longTimeoutPolicy = Policy.TimeoutAsync<HttpResponseMessage>(
    TimeSpan.FromSeconds(30));

builder.Services.AddHttpClient("PollyDynamic")
    .AddPolicyHandler(httpRequestMessage =>
        httpRequestMessage.Method == HttpMethod.Get
            ? timeoutPolicy
            : longTimeoutPolicy);

In this example, if the outgoing request is an HTTP GET, a 10-second timeout is applied. For any other HTTP method, a 30-second timeout is used.

Main Types

The main types provided by this package are:

  • PollyHttpClientBuilderExtensions: Provides extension methods for configuring PolicyHttpMessageHandler message handlers as part of an HttpClient message handler pipeline
  • PolicyHttpMessageHandler: A DelegatingHandler implementation that executes request processing surrounded by a Polly.Policy
  • PollyServiceCollectionExtensions: Provides convenience extension methods to register Polly.Registry.IPolicyRegistry<string> and Polly.Registry.IReadOnlyPolicyRegistry<string> in a service collection
  • HttpRequestMessageExtensions: Provides extension methods for HttpRequestMessage Polly integration

Additional Documentation

For additional documentation and examples, refer to the official documentation on using Polly-based handlers in ASP.NET Core.

Feedback & Contributing

Microsoft.Extensions.Http.Polly is released as open-source under the MIT license. Bug reports and contributions are welcome at the GitHub repository.

Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 was computed. 
.NET Framework net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (897)

Showing the top 5 NuGet packages that depend on Microsoft.Extensions.Http.Polly:

Package Downloads
OpenIddict.Validation.SystemNetHttp

System.Net.Http integration package for the OpenIddict validation services.

Rystem.OpenAi

.Net wrapper for OpenAI with Dependency injection integration, factory integration: you may inject more than one endpoint, azure integration: you may swap among openai endpoint and any azure endpoint quickly and easily. You can calculate tokens and cost for each request (before the request) and for each response. You can access to the dashboard api to retrieve your current or previous billing.

OpenIddict.Client.SystemNetHttp

System.Net.Http integration package for the OpenIddict client services.

Rystem.RepositoryFramework.Api.Client

Rystem.RepositoryFramework allows you to use correctly concepts like repository pattern, CQRS and DDD. You have interfaces for your domains, auto-generated api, auto-generated HttpClient to simplify connection "api to front-end", a functionality for auto-population in memory of your models, a functionality to simulate exceptions and waiting time from external sources to improve your implementation/business test and load test.

Omnia.Fx.NetCore

Package Description

GitHub repositories (121)

Showing the top 20 popular GitHub repositories that depend on Microsoft.Extensions.Http.Polly:

Repository Stars
abpframework/abp
Open-source web application framework for ASP.NET Core! Offers an opinionated architecture to build enterprise software solutions with best practices on top of the .NET. Provides the fundamental infrastructure, cross-cutting-concern implementations, startup templates, application modules, UI themes, tooling and documentation.
dotnet/AspNetCore.Docs
Documentation for ASP.NET Core
RayWangQvQ/BiliBiliToolPro
B 站(bilibili)自动任务工具,支持docker、青龙、k8s等多种部署方式。敏感肌也能用。
elsa-workflows/elsa-core
A .NET workflows library
LykosAI/StabilityMatrix
Multi-Platform Package Manager for Stable Diffusion
anjoy8/Blog.Core
💖 ASP.NET Core 8.0 全家桶教程,前后端分离后端接口,vue教程姊妹篇,官方文档:
openiddict/openiddict-core
Flexible and versatile OAuth 2.0/OpenID Connect stack for .NET
Xabaril/AspNetCore.Diagnostics.HealthChecks
Enterprise HealthChecks for ASP.NET Core Diagnostics Package
Scighost/Starward
Game Launcher for miHoYo - 米家游戏启动器
fullstackhero/blazor-starter-kit
Clean Architecture Template for Blazor WebAssembly Built with MudBlazor Components.
dotnet/extensions
This repository contains a suite of libraries that provide facilities commonly needed when creating production-ready applications.
microsoft/PowerApps-Samples
Sample code for Power Apps, including Dataverse, model-driven apps, canvas apps, Power Apps component framework, portals, and AI Builder.
NuGet/NuGetGallery
NuGet Gallery is a package repository that powers https://www.nuget.org. Use this repo for reporting NuGet.org issues.
AlphaYu/adnc
.NET微服务/分布式开发框架,同时也适用于单体架构系统的开发。
masastack/MASA.Blazor
Blazor UI component library based on Material Design. Support Blazor Server, Blazor WebAssembly and MAUI Blazor.
Cleanuparr/Cleanuparr
Cleanuparr is a tool for automating the cleanup of unwanted or blocked files in Sonarr, Radarr, and supported download clients like qBittorrent, Deluge and Transmission.
abpframework/abp-samples
Sample solutions built with the ABP Framework
OfficeDev/Microsoft-Teams-Samples
Welcome to the Microsoft Teams samples repository. Here you will find task-focused samples in C#, JavaScript and TypeScript to help you get started with the Microsoft Teams App!
meysamhadeli/booking-microservices
A practical microservices with the latest technologies and architectures like Vertical Slice Architecture, Event Sourcing, CQRS, DDD, gRpc, MongoDB, RabbitMq, Masstransit, and Aspire in .Net 9.
rogerfar/rdt-client
Real-Debrid Client Proxy
Version Downloads Last Updated
10.0.0-rc.1.25451.107 2,076 9/9/2025
10.0.0-preview.7.25380.108 6,344 8/12/2025
10.0.0-preview.6.25358.103 2,283 7/15/2025
10.0.0-preview.5.25277.114 6,563 6/6/2025
10.0.0-preview.4.25258.110 15,580 5/12/2025
10.0.0-preview.3.25172.1 4,891 4/10/2025
10.0.0-preview.2.25164.1 10,435 3/18/2025
10.0.0-preview.1.25120.3 84,826 2/25/2025
9.0.9 212,665 9/9/2025
9.0.8 1,221,331 8/5/2025
9.0.7 1,230,877 7/8/2025
9.0.6 1,752,267 6/10/2025
9.0.5 2,624,891 5/13/2025
9.0.4 3,610,545 4/8/2025
9.0.3 2,255,013 3/11/2025
9.0.2 3,383,997 2/11/2025
9.0.1 2,535,745 1/14/2025
9.0.0 5,764,821 11/12/2024
9.0.0-rc.2.24474.3 110,044 10/8/2024
9.0.0-rc.1.24452.1 47,110 9/10/2024
9.0.0-preview.7.24406.2 10,784 8/13/2024
9.0.0-preview.6.24328.4 21,203 7/9/2024
9.0.0-preview.5.24306.11 38,444 6/11/2024
9.0.0-preview.4.24267.6 8,005 5/21/2024
9.0.0-preview.3.24172.13 17,257 4/11/2024
9.0.0-preview.2.24128.4 22,780 3/12/2024
9.0.0-preview.1.24081.5 12,774 2/13/2024
8.0.20 58,142 9/9/2025
8.0.19 458,797 8/4/2025
8.0.18 282,829 7/8/2025
8.0.17 1,191,563 6/10/2025
8.0.16 594,347 5/13/2025
8.0.15 1,113,689 4/8/2025
8.0.14 1,163,751 3/11/2025
8.0.13 1,626,712 2/11/2025
8.0.12 1,622,370 1/14/2025
8.0.11 5,191,183 11/12/2024
8.0.10 9,645,357 10/8/2024
8.0.8 10,364,113 8/13/2024
8.0.7 8,978,931 7/9/2024
8.0.6 9,005,941 5/28/2024
8.0.5 3,856,182 5/14/2024
8.0.4 7,026,018 4/9/2024
8.0.3 6,031,040 3/12/2024
8.0.2 5,353,884 2/13/2024
8.0.1 6,826,728 1/9/2024
8.0.0 12,793,131 11/14/2023
8.0.0-rc.2.23480.2 62,686 10/10/2023
8.0.0-rc.1.23421.29 32,336 9/12/2023
8.0.0-preview.7.23375.9 45,307 8/8/2023
8.0.0-preview.6.23329.11 25,243 7/11/2023
8.0.0-preview.5.23302.2 13,301 6/13/2023
8.0.0-preview.4.23260.4 273,219 5/16/2023
8.0.0-preview.3.23177.8 30,224 4/11/2023
8.0.0-preview.2.23153.2 26,206 3/14/2023
8.0.0-preview.1.23112.2 15,109 2/21/2023
7.0.20 677,399 5/28/2024
7.0.19 104,799 5/14/2024
7.0.18 341,774 4/9/2024
7.0.17 274,827 3/12/2024
7.0.16 456,006 2/13/2024
7.0.15 786,181 1/9/2024
7.0.14 1,631,863 11/14/2023
7.0.13 2,319,088 10/24/2023
7.0.12 6,029,098 10/10/2023
7.0.11 3,135,466 9/12/2023
7.0.10 4,862,857 8/8/2023
7.0.9 3,946,213 7/11/2023
7.0.8 1,871,317 6/22/2023
7.0.7 1,799,438 6/13/2023
7.0.5 9,712,364 4/11/2023
7.0.4 3,967,607 3/14/2023
7.0.3 3,085,351 2/14/2023
7.0.2 3,976,156 1/10/2023
7.0.1 2,607,034 12/13/2022
7.0.0 5,105,210 11/7/2022
7.0.0-rc.2.22476.2 32,279 10/11/2022
7.0.0-rc.1.22427.2 41,763 9/14/2022
7.0.0-preview.7.22376.6 35,050 8/9/2022
7.0.0-preview.6.22330.3 35,728 7/12/2022
7.0.0-preview.5.22303.8 12,228 6/14/2022
7.0.0-preview.4.22251.1 17,886 5/10/2022
7.0.0-preview.3.22178.4 9,615 4/13/2022
7.0.0-preview.2.22153.2 29,829 3/14/2022
7.0.0-preview.1.22109.13 7,280 2/17/2022
6.0.36 284,725 11/12/2024
6.0.35 206,621 10/8/2024
6.0.33 380,987 8/13/2024
6.0.32 299,757 7/9/2024
6.0.31 460,729 5/28/2024
6.0.30 130,432 5/14/2024
6.0.29 536,249 4/9/2024
6.0.28 629,671 3/12/2024
6.0.27 491,557 2/13/2024
6.0.26 1,443,568 1/9/2024
6.0.25 1,338,876 11/14/2023
6.0.24 813,501 10/24/2023
6.0.23 589,903 10/10/2023
6.0.22 879,174 9/12/2023
6.0.21 1,298,042 8/8/2023
6.0.20 1,109,225 7/11/2023
6.0.19 677,218 6/22/2023
6.0.18 603,004 6/13/2023
6.0.16 3,355,937 4/11/2023
6.0.15 1,586,797 3/14/2023
6.0.14 1,517,412 2/14/2023
6.0.13 2,253,843 1/10/2023
6.0.12 1,652,476 12/13/2022
6.0.11 2,697,743 11/7/2022
6.0.10 6,614,895 10/11/2022
6.0.9 5,809,082 9/13/2022
6.0.8 7,920,005 8/9/2022
6.0.7 5,920,096 7/12/2022
6.0.6 4,325,495 6/14/2022
6.0.5 5,272,688 5/10/2022
6.0.4 4,785,335 4/11/2022
6.0.3 4,832,198 3/8/2022
6.0.2 4,399,517 2/8/2022
6.0.1 6,980,196 12/14/2021
6.0.0 13,563,300 11/8/2021
6.0.0-rc.2.21480.10 35,694 10/12/2021
6.0.0-rc.1.21452.15 12,903 9/14/2021
6.0.0-preview.7.21378.6 17,067 8/10/2021
6.0.0-preview.6.21355.2 5,653 7/14/2021
6.0.0-preview.5.21301.17 13,022 6/15/2021
6.0.0-preview.4.21253.5 9,519 5/24/2021
6.0.0-preview.3.21201.13 11,268 4/8/2021
6.0.0-preview.2.21154.6 7,648 3/11/2021 6.0.0-preview.2.21154.6 is deprecated because it is no longer maintained.
6.0.0-preview.1.21103.6 27,302 2/12/2021 6.0.0-preview.1.21103.6 is deprecated because it is no longer maintained.
5.0.1 23,524,902 12/8/2020 5.0.1 is deprecated because it is no longer maintained.
5.0.0 4,564,864 11/9/2020 5.0.0 is deprecated because it is no longer maintained.
5.0.0-rc.2.20478.4 11,707 10/13/2020 5.0.0-rc.2.20478.4 is deprecated because it is no longer maintained.
5.0.0-rc.1.20451.7 9,106 9/14/2020 5.0.0-rc.1.20451.7 is deprecated because it is no longer maintained.
5.0.0-preview.8.20407.3 3,386 8/25/2020 5.0.0-preview.8.20407.3 is deprecated because it is no longer maintained.
5.0.0-preview.7.20365.4 10,687 7/21/2020 5.0.0-preview.7.20365.4 is deprecated because it is no longer maintained.
5.0.0-preview.6.20306.1 18,377 6/25/2020 5.0.0-preview.6.20306.1 is deprecated because it is no longer maintained.
5.0.0-preview.5.20278.3 4,201 6/10/2020 5.0.0-preview.5.20278.3 is deprecated because it is no longer maintained.
5.0.0-preview.4.20251.2 2,753 5/18/2020 5.0.0-preview.4.20251.2 is deprecated because it is no longer maintained.
5.0.0-preview.3.20215.2 10,676 4/23/2020 5.0.0-preview.3.20215.2 is deprecated because it is no longer maintained.
5.0.0-preview.2.20160.3 30,497 4/2/2020 5.0.0-preview.2.20160.3 is deprecated because it is no longer maintained.
5.0.0-preview.1.20120.4 4,428 3/16/2020 5.0.0-preview.1.20120.4 is deprecated because it is no longer maintained.
3.1.32 1,055,475 12/13/2022
3.1.31 159,982 11/8/2022
3.1.30 146,487 10/11/2022
3.1.29 146,819 9/13/2022
3.1.28 519,213 8/9/2022
3.1.27 113,303 7/12/2022
3.1.26 141,379 6/14/2022
3.1.25 332,017 5/10/2022
3.1.24 199,472 4/11/2022
3.1.23 276,528 3/8/2022
3.1.22 2,573,708 12/14/2021
3.1.21 747,184 11/7/2021
3.1.20 364,125 10/11/2021
3.1.19 550,432 9/14/2021
3.1.18 630,794 8/10/2021
3.1.17 1,027,276 7/13/2021
3.1.16 5,075,232 6/8/2021
3.1.15 1,223,698 5/11/2021
3.1.14 1,176,981 4/6/2021
3.1.13 3,385,638 3/9/2021
3.1.12 2,159,436 2/9/2021
3.1.11 693,467 1/12/2021
3.1.10 2,219,903 11/9/2020
3.1.9 2,991,486 10/13/2020
3.1.8 3,813,893 9/8/2020
3.1.7 7,189,407 8/11/2020
3.1.6 3,562,550 7/14/2020
3.1.5 5,123,267 6/9/2020
3.1.4 2,730,840 5/12/2020
3.1.3 3,479,847 3/24/2020
3.1.2 2,825,072 2/18/2020
3.1.1 3,448,004 1/14/2020
3.1.0 4,886,295 12/3/2019
3.1.0-preview3.19553.2 3,250 11/13/2019 3.1.0-preview3.19553.2 is deprecated because it is no longer maintained.
3.1.0-preview2.19525.4 1,827 11/1/2019 3.1.0-preview2.19525.4 is deprecated because it is no longer maintained.
3.1.0-preview1.19506.1 1,184 10/15/2019 3.1.0-preview1.19506.1 is deprecated because it is no longer maintained.
3.0.3 227,579 2/18/2020 3.0.3 is deprecated because it is no longer maintained.
3.0.2 47,253 1/14/2020 3.0.2 is deprecated because it is no longer maintained.
3.0.1 293,649 11/18/2019 3.0.1 is deprecated because it is no longer maintained.
3.0.0 2,815,783 9/23/2019 3.0.0 is deprecated because it is no longer maintained.
3.0.0-rc1.19456.10 6,475 9/16/2019 3.0.0-rc1.19456.10 is deprecated because it is no longer maintained.
3.0.0-preview9.19423.4 8,040 9/4/2019 3.0.0-preview9.19423.4 is deprecated because it is no longer maintained.
3.0.0-preview8.19405.4 4,871 8/13/2019 3.0.0-preview8.19405.4 is deprecated because it is no longer maintained.
3.0.0-preview7.19362.4 3,365 7/23/2019 3.0.0-preview7.19362.4 is deprecated because it is no longer maintained.
3.0.0-preview6.19304.6 4,323 6/12/2019 3.0.0-preview6.19304.6 is deprecated because it is no longer maintained.
3.0.0-preview5.19227.9 9,097 5/6/2019 3.0.0-preview5.19227.9 is deprecated because it is no longer maintained.
3.0.0-preview4.19216.2 1,366 4/18/2019 3.0.0-preview4.19216.2 is deprecated because it is no longer maintained.
3.0.0-preview3.19153.1 1,560 3/6/2019 3.0.0-preview3.19153.1 is deprecated because it is no longer maintained.
3.0.0-preview.19074.2 2,599 1/29/2019 3.0.0-preview.19074.2 is deprecated because it is no longer maintained.
3.0.0-preview.18572.1 2,302 12/4/2018 3.0.0-preview.18572.1 is deprecated because it is no longer maintained.
2.2.0 13,836,763 12/3/2018 2.2.0 is deprecated because it is no longer maintained.
2.2.0-preview3-35497 14,954 10/17/2018 2.2.0-preview3-35497 is deprecated because it is no longer maintained.
2.2.0-preview2-35157 6,691 9/12/2018 2.2.0-preview2-35157 is deprecated because it is no longer maintained.
2.2.0-preview1-35029 4,579 8/22/2018 2.2.0-preview1-35029 is deprecated because it is no longer maintained.
2.1.1 5,431,113 6/18/2018
2.1.0 2,803,710 5/29/2018
2.1.0-rc1-final 10,754 5/6/2018 2.1.0-rc1-final is deprecated because it is no longer maintained.
2.1.0-preview2-final 4,525 4/13/2018 2.1.0-preview2-final is deprecated because it is no longer maintained.