Soenneker.Utils.Dotnet 4.0.2656

Prefix Reserved
dotnet add package Soenneker.Utils.Dotnet --version 4.0.2656
                    
NuGet\Install-Package Soenneker.Utils.Dotnet -Version 4.0.2656
                    
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="4.0.2656" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Soenneker.Utils.Dotnet" Version="4.0.2656" />
                    
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 4.0.2656
                    
#r "nuget: Soenneker.Utils.Dotnet, 4.0.2656"
                    
#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@4.0.2656
                    
#: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=4.0.2656
                    
Install as a Cake Addin
#tool nuget:?package=Soenneker.Utils.Dotnet&version=4.0.2656
                    
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 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 (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
4.0.2656 597 10/15/2026
4.0.2655 396 10/15/2026
4.0.2654 322 10/15/2026
4.0.2653 38 10/15/2026
4.0.2652 149 10/14/2026
4.0.2651 155 10/14/2026
4.0.2650 2,521 10/14/2026
4.0.2646 69 10/14/2026
4.0.2639 201 10/13/2026
4.0.2636 83 10/13/2026
4.0.2635 80 10/13/2026
4.0.2632 2,007 10/12/2026
4.0.2631 89 10/12/2026
4.0.2630 1,945 10/12/2026
4.0.2629 90 10/12/2026
4.0.2627 125 10/11/2026
4.0.2626 119 10/11/2026
4.0.2625 80 10/11/2026
4.0.2623 127 10/11/2026
4.0.2622 95 10/11/2026
Loading failed

Updated Multiple NuGet packages