HostingHostBuilderExtensions.RunConsoleAsync HostingHostBuilderExtensions.RunConsoleAsync Method

Definition

Overloads

RunConsoleAsync(IHostBuilder, CancellationToken) RunConsoleAsync(IHostBuilder, CancellationToken)

Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down.

RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken) RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)

Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down.

RunConsoleAsync(IHostBuilder, CancellationToken) RunConsoleAsync(IHostBuilder, CancellationToken)

Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down.

public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Threading.CancellationToken cancellationToken = null);
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

hostBuilder
IHostBuilder IHostBuilder

The IHostBuilder to configure.

Returns

RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken) RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)

Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down.

public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions, System.Threading.CancellationToken cancellationToken = null);
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * System.Threading.CancellationToken -> System.Threading.Tasks.Task

Parameters

hostBuilder
IHostBuilder IHostBuilder

The IHostBuilder to configure.

configureOptions
Action<ConsoleLifetimeOptions>

Returns

Applies to