Soenneker.Managers.NuGetPackage 4.0.1308

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

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

Soenneker.Managers.NuGetPackage

Stages a file or directory into a library's Resources folder, builds and packs the project, then pushes the resulting package to NuGet.

Install

dotnet add package Soenneker.Managers.NuGetPackage

Usage

using Microsoft.Extensions.DependencyInjection;
using Soenneker.Managers.NuGetPackage.Abstract;
using Soenneker.Managers.NuGetPackage.Registrars;

services.AddNuGetPackageManagerAsSingleton();

INuGetPackageManager packages =
    serviceProvider.GetRequiredService<INuGetPackageManager>();

await packages.BuildPackAndPushFile(
    gitDirectory: repositoryPath,
    libraryName: "Soenneker.Libraries.Tool.Windows",
    targetFilePath: Path.Combine(repositoryPath, "src", "Soenneker.Libraries.Tool.Windows", "Resources", "tool.exe"),
    sourceFilePath: downloadedToolPath,
    version: buildVersion,
    nuGetToken: nugetToken,
    cancellationToken);

This is a publishing operation, not a package-building preview: a successful call pushes to the configured NuGet source.

What you get

  • INuGetPackageManager — Handles building, packaging, and publishing .NET projects to NuGet.
  • NuGetPackageManagerRegistrar — Handles building, packaging, and publishing .NET projects to NuGet.

API at a glance

API What it does Result / important behavior
NuGetPackageManagerRegistrar.AddNuGetPackageManagerAsSingleton(services) Adds INuGetPackageManager as a singleton service. The same service collection, so additional registrations can be chained.
NuGetPackageManagerRegistrar.AddNuGetPackageManagerAsScoped(services) Adds INuGetPackageManager as a scoped service. The same service collection, so additional registrations can be chained.

Important behavior

  • The target file or directory is deleted and replaced before restore/build/pack begins.
  • Targets, the project file, and the expected .nupkg must resolve inside gitDirectory; resource targets must remain beneath the selected library's Resources folder.
  • The source file or directory may be outside the checkout and is never deleted by this manager.
  • Packages are built in Release configuration and written to the checkout root as <libraryName>.<version>.nupkg.
  • Keep the NuGet token in a secret provider. The token is passed only to the push operation.
  • Cancellation or a failed build can leave the dedicated checkout modified. Use a disposable checkout and clean it up at the workflow boundary.
Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  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. 
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.Managers.NuGetPackage:

Package Downloads
Soenneker.Managers.Runners

Handles Runner operations and coordination

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
4.0.1308 0 9/9/2026
4.0.1307 0 9/9/2026
4.0.1306 0 9/9/2026
4.0.1305 145 9/9/2026
4.0.1304 3,022 9/8/2026
4.0.1303 493 9/8/2026
4.0.1302 159 9/8/2026
4.0.1301 2,103 9/7/2026
4.0.1300 4,238 9/5/2026
4.0.1299 846 9/5/2026
4.0.1298 1,914 9/5/2026
4.0.1297 81 9/4/2026
4.0.1296 85 9/4/2026
4.0.1295 773 9/4/2026
4.0.1294 7,030 9/4/2026
4.0.1293 1,125 9/4/2026
4.0.1292 1,114 9/4/2026
4.0.1291 4,311 9/1/2026
4.0.1290 245 9/1/2026
4.0.1289 1,189 9/1/2026
Loading failed

Update dependency Soenneker.Utils.Dotnet.NuGet to 4.0.2094 (#1861)