Table of Contents

Class ProcessHostExtensions

Namespace
Invex.Process
Assembly
Invex.Process.dll

Provides extension methods for registering the process runner service with an Microsoft.Extensions.DependencyInjection.IServiceCollection.

public static class ProcessHostExtensions
Inheritance
object
ProcessHostExtensions

Methods

AddProcessRunner(IServiceCollection)

Registers IProcessRunner as a singleton backed by the default Invex.Process.ProcessRunner implementation.

public static IServiceCollection AddProcessRunner(this IServiceCollection serviceCollection)

Parameters

serviceCollection IServiceCollection

Returns

IServiceCollection

The same Microsoft.Extensions.DependencyInjection.IServiceCollection for further configuration.

Examples

var builder = Host.CreateApplicationBuilder(args);
builder.Services.AddProcessRunner();

Remarks

Call this once during host setup so that build targets and helpers can inject IProcessRunner rather than constructing System.Diagnostics.Process instances directly.