HostingAbstractionsHostBuilderExtensions.StartAsync Method

Definition

Builds and starts the host.

public static System.Threading.Tasks.Task<Microsoft.Extensions.Hosting.IHost> StartAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Threading.CancellationToken cancellationToken = default);
static member StartAsync : Microsoft.Extensions.Hosting.IHostBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Microsoft.Extensions.Hosting.IHost>
<Extension()>
Public Function StartAsync (hostBuilder As IHostBuilder, Optional cancellationToken As CancellationToken = Nothing) As Task(Of IHost)

Parameters

hostBuilder
IHostBuilder

The IHostBuilder to start.

cancellationToken
CancellationToken

A CancellationToken that can be used to cancel the start.

Returns

Task<IHost>

The started IHost.

Applies to