Soenneker.Utils.Dotnet 11.0.2687

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

DI-friendly wrappers around the dotnet CLI for restore, build, run, test, pack, clean, and NuGet package operations.

Installation

dotnet add package Soenneker.Utils.Dotnet

Registration

builder.Services.AddDotnetUtilAsSingleton();

Scoped registration is also available with AddDotnetUtilAsScoped().

Build workflow

bool restored = await dotnet.Restore(solutionPath, cancellationToken: cancellationToken);

bool built = restored && await dotnet.Build(
    solutionPath,
    configuration: "Release",
    restore: false,
    cancellationToken: cancellationToken);

bool packed = built && await dotnet.Pack(
    projectPath,
    version: "1.2.3",
    build: false,
    restore: false,
    output: packageDirectory,
    cancellationToken: cancellationToken);

The typed command methods return false when the CLI cannot be started or exits unsuccessfully. Cancellation remains cancellation and throws OperationCanceledException; it is not converted to false.

Execute(arguments) accepts the complete raw argument string after dotnet and returns captured output. Use it only with arguments assembled from trusted values. Prefer the typed methods when user-controlled paths or options are involved.

Run an application

Run() waits for dotnet run to exit:

bool succeeded = await dotnet.Run(
    projectPath,
    configuration: "Release",
    applicationArguments: ["--import", inputPath],
    cancellationToken: cancellationToken);

Start() returns after launching a long-running process:

using Process? process = await dotnet.Start(
    projectPath,
    outputCallback: line => logger.LogInformation("{Line}", line),
    errorCallback: line => logger.LogError("{Line}", line),
    cancellationToken: stoppingToken);

Cancelling the token supplied to Start() kills the launched process tree. The caller owns the returned Process and should dispose it. A null result means path validation or process startup failed; it does not mean the launched application later exited successfully.

Package inspection and updates

List<KeyValuePair<string, string>> outdated = await dotnet.ListPackages(
    projectPath,
    outdated: true,
    cancellationToken: cancellationToken);

bool updated = await dotnet.UpdatePackages(repositoryPath, cancellationToken: cancellationToken);

UpdatePackages() finds project files recursively, restores the path, updates each outdated top-level package, and restores again. It edits project files incrementally and does not roll back earlier updates when a later package or final restore fails. Run it in a clean, version-controlled working tree when those mutations need review or recovery.

The utility sets the CLI language to English, disables telemetry, and suppresses the .NET logo so package-list JSON and captured output remain predictable.

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 (2)

Showing the top 2 NuGet packages that depend on Soenneker.Utils.Dotnet:

Package Downloads
Soenneker.Utils.Dotnet.NuGet

A utility library for dotnet NuGet operations

Soenneker.Playwrights.TestEnvironment

A test environment for testing with Playwright

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
11.0.2687 0 11/11/2026
11.0.2686 0 11/11/2026
11.0.2684 0 11/11/2026
11.0.2683 0 11/11/2026
11.0.2682 0 11/11/2026
11.0.2681 0 11/11/2026
11.0.2679 0 11/11/2026
11.0.2678 0 11/11/2026
11.0.2677 7 11/11/2026
11.0.2675 45 11/11/2026
11.0.2674 43 11/11/2026
11.0.2673 7,883 11/3/2026
11.0.2672 601 11/3/2026
11.0.2671 96 11/3/2026
11.0.2670 363 11/3/2026
11.0.2669 112 11/3/2026
11.0.2668 608 11/3/2026
11.0.2667 175 11/3/2026
11.0.2665 1,148 11/2/2026
11.0.2664 7,105 10/29/2026
Loading failed

Updated Multiple NuGet packages