HttpClient.Resilience.Analyzers 0.1.135

There is a newer version of this package available.
See the version list below for details.
dotnet add package HttpClient.Resilience.Analyzers --version 0.1.135
                    
NuGet\Install-Package HttpClient.Resilience.Analyzers -Version 0.1.135
                    
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="HttpClient.Resilience.Analyzers" Version="0.1.135">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="HttpClient.Resilience.Analyzers" Version="0.1.135" />
                    
Directory.Packages.props
<PackageReference Include="HttpClient.Resilience.Analyzers">
  <PrivateAssets>all</PrivateAssets>
  <IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
                    
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 HttpClient.Resilience.Analyzers --version 0.1.135
                    
#r "nuget: HttpClient.Resilience.Analyzers, 0.1.135"
                    
#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 HttpClient.Resilience.Analyzers@0.1.135
                    
#: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=HttpClient.Resilience.Analyzers&version=0.1.135
                    
Install as a Cake Addin
#tool nuget:?package=HttpClient.Resilience.Analyzers&version=0.1.135
                    
Install as a Cake Tool

<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.135" 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

Licensed under the MIT License.

There are no supported framework assets in this package.

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
Loading failed

Detect HCR083 relative URLs through null-forgiving request and URL expressions.