WebHostExtensions.Run Method

Definition

Overloads

Run(IWebHost)

Runs a web application and block the calling thread until host shutdown.

Run(IWebHost, CancellationToken)

Runs a web application and block the calling thread until token is triggered or shutdown is triggered.

Run(IWebHost)

Source:
WebHostExtensions.cs
Source:
WebHostExtensions.cs
Source:
WebHostExtensions.cs

Runs a web application and block the calling thread until host shutdown.

C#
public static void Run (this Microsoft.AspNetCore.Hosting.IWebHost host);

Parameters

host
IWebHost

The IWebHost to run.

Applies to

ASP.NET Core 9.0 dan versi lain
Produk Versi
ASP.NET Core 1.0, 1.1, 2.0, 2.1, 2.2, 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0

Run(IWebHost, CancellationToken)

Runs a web application and block the calling thread until token is triggered or shutdown is triggered.

C#
public static void Run (this Microsoft.AspNetCore.Hosting.IWebHost host, System.Threading.CancellationToken token);

Parameters

host
IWebHost

The IWebHost to run.

token
CancellationToken

The token to trigger shutdown.

Applies to

ASP.NET Core 1.1 dan ASP.NET Core 1.0
Produk Versi
ASP.NET Core 1.0, 1.1