WebHostExtensions.RunAsync(IWebHost, CancellationToken) Method

Definition

Runs a web application and returns a Task that only completes when the token is triggered or shutdown is triggered.

C#
public static System.Threading.Tasks.Task RunAsync (this Microsoft.AspNetCore.Hosting.IWebHost host, System.Threading.CancellationToken token = default);

Parameters

host
IWebHost

The IWebHost to run.

token
CancellationToken

The token to trigger shutdown.

Returns

Applies to

Product Versions
ASP.NET Core 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0