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

Soenneker.NuGet.Client

alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image alternate text is missing from this package README image

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 Compatible and additional computed target framework versions.
.NET net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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

Update dependency Soenneker.Utils.HttpClientCache to 11.0.2155 (#2415)