HostingAbstractionsHostBuilderExtensions.StartAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
The started IHost.