Soenneker.NuGet.Client
11.0.1826
Prefix Reserved
dotnet add package Soenneker.NuGet.Client --version 11.0.1826
NuGet\Install-Package Soenneker.NuGet.Client -Version 11.0.1826
<PackageReference Include="Soenneker.NuGet.Client" Version="11.0.1826" />
<PackageVersion Include="Soenneker.NuGet.Client" Version="11.0.1826" />
<PackageReference Include="Soenneker.NuGet.Client" />
paket add Soenneker.NuGet.Client --version 11.0.1826
#r "nuget: Soenneker.NuGet.Client, 11.0.1826"
#:package Soenneker.NuGet.Client@11.0.1826
#addin nuget:?package=Soenneker.NuGet.Client&version=11.0.1826
#tool nuget:?package=Soenneker.NuGet.Client&version=11.0.1826
Soenneker.NuGet.Client
Provides a dependency-injected accessor for a shared HttpClient used by NuGet protocol code.
Installation
dotnet add package Soenneker.NuGet.Client
Registration
using Soenneker.NuGet.Client.Registrars;
builder.Services.AddNuGetClientAsScoped();
// or: builder.Services.AddNuGetClientAsSingleton();
Both registrations keep the underlying HTTP client cache singleton. A scoped accessor can be disposed at the end of its scope without removing or disposing the shared client.
Usage
using Soenneker.NuGet.Client.Abstract;
HttpClient client = await nugetClient.Get(cancellationToken);
using HttpResponseMessage response = await client.GetAsync(
"https://api.nuget.org/v3/index.json",
cancellationToken);
response.EnsureSuccessStatusCode();
string serviceIndex = await response.Content.ReadAsStringAsync(cancellationToken);
Do not dispose the HttpClient returned by Get; it is shared and owned by the singleton cache. Dispose request and response messages created by the calling code.
This package does not set a base address, implement NuGet service-index discovery, serialize protocol models, add authentication, retry requests, or validate source URLs. Use absolute request URIs and apply explicit timeouts and retry policy where the operation requires them. If package-source URLs can come from users or tenants, constrain them to approved HTTPS hosts to avoid server-side request forgery.
For higher-level search, version, catalog, dependency, and publishing operations, use Soenneker.Utils.NuGet, which consumes this client.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net11.0 is compatible. |
-
net11.0
- Soenneker.Utils.HttpClientCache (>= 11.0.2155)
NuGet packages (1)
Showing the top 1 NuGet packages that depend on Soenneker.NuGet.Client:
| Package | Downloads |
|---|---|
|
Soenneker.Utils.NuGet
Queries NuGet V3 feeds for package metadata and versions, dependency metadata, and package unlisting. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 11.0.1826 | 0 | 11/15/2026 |
| 11.0.1824 | 627 | 11/11/2026 |
| 11.0.1823 | 78 | 11/11/2026 |
| 11.0.1822 | 94 | 11/11/2026 |
| 11.0.1821 | 68 | 11/11/2026 |
| 11.0.1820 | 320 | 11/3/2026 |
| 11.0.1819 | 118 | 11/3/2026 |
| 11.0.1818 | 108 | 11/3/2026 |
| 11.0.1817 | 123 | 11/3/2026 |
| 11.0.1816 | 203 | 10/27/2026 |
| 11.0.1815 | 141 | 10/27/2026 |
| 11.0.1814 | 113 | 10/26/2026 |
| 11.0.1813 | 112 | 10/26/2026 |
| 11.0.1810 | 145 | 10/26/2026 |
| 11.0.1809 | 131 | 10/26/2026 |
| 4.0.1808 | 198 | 10/15/2026 |
| 4.0.1807 | 143 | 10/14/2026 |
| 4.0.1806 | 134 | 10/14/2026 |
| 4.0.1805 | 120 | 10/14/2026 |
| 4.0.1803 | 107 | 10/14/2026 |
Update dependency Soenneker.Utils.HttpClientCache to 11.0.2155 (#2415)