Skip to content

Repository files navigation

🗂️ Portfolio archive — .NET library, published to NuGet (C#). Launches OS processes as cancellable Tasks. Part of a consolidated set of my personal repositories and not actively maintained (dormant since 2019).

📋 Self-review — 5 good practices & 5 things I'd improve

✅ Good practices demonstrated

  1. Published as a proper NuGet package.
  2. Real unit tests plus CI (AppVeyor) and quality gates (SonarCloud, Codacy).
  3. Semantic versioning via GitVersion and dependency automation via Renovate.
  4. LICENSE and a clear, badged README.
  5. A focused, single-responsibility API — good small-library design.

⚠️ Weaknesses / what I'd do differently today

  1. Dormant since 2019 and tied to older .NET Framework tooling.
  2. CI on AppVeyor rather than GitHub Actions (now the norm for this stack).
  3. IDE settings files (.sln.DotSettings) committed to the repo.
  4. Some badges reference services/URLs that have since changed.
  5. No modern multi-targeting (.NET Standard / .NET 8+) to keep it usable today.

ProcessStartAsync

Build status Build status Codacy Badge codecov NuGet

A basic library to launch Processes as Cancellable Tasks

Usage

Invoke a process and get the exit code as the result

using System.Diagnostics;

// ...

var process = new ProcessStartInfo("cmd.exe", "/c Hello World!");
var result = await process.StartAsync();
result.Should().Be(0);

Invoke a process and cancel if it doesn't complete within a set time

using System.Diagnostics;

// ...

try
{
    var process = new ProcessStartInfo("cmd.exe", "/c ping -t 127.0.0.1");
    var cts = new CancellationTokenSource();
    cts.CancelAfter(TimeSpan.FromMinutes(1));
    await process.StartAsync(cts.Token);
}
catch (TaskCanceledException)
{
    // One minute later
}

Invoke a process and capture its output in a StringBuilder

using System.Diagnostics;

// ...

var output = new StringBuilder();
var psi = new ProcessStartInfo("cmd.exe", @"/c tree \");
await psi.StartAsync((string line) => output.AppendLine(line)).ConfigureAwait(false);
return output.ToString();

About

A basic library to launch Processes as Cancellable Tasks

Topics

Resources

Stars

Watchers

Forks

Releases

Packages

Used by

Contributors

Languages