Skip to content

Repository files navigation

WindowsJobAPI

NuGet

A small .NET library for grouping processes in a Windows Job Object. Disposing the job terminates every process assigned to it.

Note: Starting with .NET 11, if you only need a newly started child process to terminate when its parent process exits, use the built-in ProcessStartInfo.KillOnParentExit property instead.

Usage

usingSystem.Diagnostics;usingWindowsJobAPI;usingProcessprocess=Process.Start(newProcessStartInfo{FileName="cmd.exe",UseShellExecute=false,})??thrownewInvalidOperationException("Unable to start the process.");usingJobObjectjob=new();if(!job.AddProcess(process)){thrownewInvalidOperationException("Unable to add the process to the job.");}// Disposing job terminates process and any child processes in the same job.

License

MIT

About

A small .NET library for grouping processes in a Windows Job Object. Disposing the job terminates every process assigned to it.

Resources

Stars

9 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages