stop 2.1.0

dotnet tool install --global stop --version 2.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest
                    
if you are setting up this repo
dotnet tool install --local stop --version 2.1.0
                    
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=stop&version=2.1.0
                    
nuke :add-package stop --version 2.1.0
                    

A dotnet global tool that gracefully stops processes by sending them SIGINT (Ctrl+C) in a cross platform way.

Why

PowerShell's Stop-Process (and the underlying TerminateProcess on Windows / SIGKILL on Unix) kills a process immediately — the target has no opportunity to clean up. This matters for apps that rely on graceful shutdown: flushing writes to disk, completing in-flight work, disposing resources, or honouring a CancellationToken in a .NET IHost/IHostedService.

dnx stop sends SIGINT instead — the same signal as pressing Ctrl+C — which lets the process shut down on its own terms. On Windows this is non-trivial to do programmatically; for console apps it requires detaching from the current console, attaching to the target process's console group, and calling GenerateConsoleCtrlEvent. For GUI apps (including UWP apps like Calculator), it sends WM_CLOSE to the app's windows — the same as clicking the close button. This tool handles all of that transparently, cross-platform.

dnx stop [<processId>] [--timeout <milliseconds>] [--quiet]
Usage: [arguments...] [options...] [-h|--help] [--version]

Sends the SIGINT (Ctrl+C) signal to a process to gracefully stop it.

Arguments:
  [0] <int?>    ID of the process to stop. When omitted, reads process IDs from standard input.

Options:
  -t, --timeout <int?>    Optional timeout in milliseconds to wait for the process to exit.
  -q, --quiet             Do not display any output.
  -d, --debug             Print diagnostic details about the stop operation.
  --attach                Attach a .NET debugger before stopping.

If no timeout is provided, the tool will wait indefinitely for the target process to exit. Otherwise, the process will exit with a non-zero exit code if the target process didn't exit within the specified timeout time.

Piping from PowerShell

When no process ID is given, dnx stop reads process IDs from standard input. This allows piping directly from PowerShell's Get-Process:

# Stop all processes named 'foo'
Get-Process -Name foo | dnx stop

# Stop multiple processes by name
Get-Process -Name foo, bar | dnx stop

You can also pipe just the IDs:

Get-Process -Name foo | Select-Object -ExpandProperty Id | dnx stop

Sponsors

Clarius Org MFB Technologies, Inc. SandRock DRIVE.NET, Inc. Keith Pickford Thomas Bolon Kori Francis Reuben Swartz Jacob Foshee alternate text is missing from this package README image Eric Johnson Jonathan Ken Bonny Simon Cropp agileworks-eu Zheyu Shen Vezel ChilliCream 4OTC domischell Adrian Alonso torutek Ryan McCaffery Seika Logiciel Andrew Grant eska-gmbh Geodata AS

Sponsor this project

Learn more about GitHub Sponsors

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.

This package has no dependencies.

Version Downloads Last Updated
2.1.0 190 6/15/2026
2.1.0-rc 137 6/15/2026
2.0.1 181 5/15/2026
2.0.0 191 5/5/2026
2.0.0-alpha 172 5/5/2026
1.1.2 121 12/31/2025
1.1.1 81 12/31/2025
1.1.0 91 12/31/2025