HttpClient.Resilience.Analyzers
0.1.126
See the version list below for details.
dotnet add package HttpClient.Resilience.Analyzers --version 0.1.126
NuGet\Install-Package HttpClient.Resilience.Analyzers -Version 0.1.126
<PackageReference Include="HttpClient.Resilience.Analyzers" Version="0.1.126"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
<PackageVersion Include="HttpClient.Resilience.Analyzers" Version="0.1.126" />
<PackageReference Include="HttpClient.Resilience.Analyzers"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets> </PackageReference>
paket add HttpClient.Resilience.Analyzers --version 0.1.126
#r "nuget: HttpClient.Resilience.Analyzers, 0.1.126"
#:package HttpClient.Resilience.Analyzers@0.1.126
#addin nuget:?package=HttpClient.Resilience.Analyzers&version=0.1.126
#tool nuget:?package=HttpClient.Resilience.Analyzers&version=0.1.126
<p align="center"> <img src="https://raw.githubusercontent.com/georgepwall1991/HttpClient.Resilience.Analyzers/main/assets/logo.png" alt="HttpClient.Resilience.Analyzers logo" width="160"> </p>
HttpClient Resilience Analyzers for .NET
Production-focused Roslyn analyzers and code fixes for HttpClient, IHttpClientFactory, typed and named clients, Polly, and Microsoft.Extensions.Http.Resilience.
Catch outbound HTTP reliability bugs at compile time: socket exhaustion, stale DNS connections, dependency-injection lifetime leaks, unsafe retries, missing cancellation tokens, undisposed responses and streams, sync-over-async, and unbounded fan-out.
Analyzer-only package: no runtime dependency is added to your application.
Install
dotnet add package HttpClient.Resilience.Analyzers
For a library or shared project, keep the analyzer private to the project:
<PackageReference Include="HttpClient.Resilience.Analyzers" Version="0.1.126" PrivateAssets="all" />
Build normally with dotnet build. Diagnostics appear in supported IDEs, command-line builds, and CI without application configuration.
What It Detects
| Area | Examples |
|---|---|
HttpClient lifetime |
Per-request client creation, stale long-lived connections, cached factory clients |
| Dependency injection | Typed clients held by singletons, duplicate registrations, scoped state captured by handlers |
| Resilience and Polly | Duplicate handlers, unsafe HTTP method retries, per-request pipeline construction |
| Response ownership | Undisposed ResponseHeadersRead responses and HTTP content streams |
| Request correctness | Unchecked failure responses, shared default-header mutation, dropped cancellation tokens |
| Async and concurrency | Sync-over-async and obvious unbounded HTTP fan-out |
| Typed and named clients | Relative URLs without BaseAddress and duplicated string client names |
The package currently contains 18 documented diagnostics, including automatic fixes for common lifetime, retry, response-disposal, cancellation, and registration problems.
Configure Severity
Every rule can be configured through .editorconfig:
[*.cs]
dotnet_diagnostic.HCR041.severity = error
dotnet_diagnostic.HCR080.severity = suggestion
Ready-made profiles are included in the package and repository for default, brownfield, strict-CI, and library-author adoption.
Documentation
- Complete rule catalog
- Configuration guide
- Adoption guide
- Implementation status and limitations
- Report a bug or false positive
- Source code and releases
Licensed under the MIT License.
Learn more about Target Frameworks and .NET Standard.
-
.NETStandard 2.0
- No dependencies.
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.1.140 | 0 | 7/23/2026 |
| 0.1.139 | 0 | 7/23/2026 |
| 0.1.138 | 0 | 7/23/2026 |
| 0.1.137 | 0 | 7/23/2026 |
| 0.1.136 | 0 | 7/23/2026 |
| 0.1.135 | 0 | 7/23/2026 |
| 0.1.134 | 0 | 7/23/2026 |
| 0.1.133 | 0 | 7/23/2026 |
| 0.1.132 | 0 | 7/23/2026 |
| 0.1.131 | 0 | 7/22/2026 |
| 0.1.130 | 0 | 7/22/2026 |
| 0.1.129 | 0 | 7/22/2026 |
| 0.1.128 | 0 | 7/22/2026 |
| 0.1.127 | 0 | 7/22/2026 |
| 0.1.126 | 0 | 7/22/2026 |
| 0.1.125 | 0 | 7/22/2026 |
| 0.1.124 | 0 | 7/22/2026 |
| 0.1.123 | 0 | 7/22/2026 |
| 0.1.122 | 0 | 7/22/2026 |
| 0.1.121 | 0 | 7/22/2026 |
Trace HCR080 unbounded HTTP fan-out through null-forgiving task-sequence syntax.