WebHostExtensions Class

Namespace
Microsoft.AspNetCore.Hosting
Assemblies
  • Microsoft.AspNetCore.Hosting

Syntax

public class WebHostExtensions
class Microsoft.AspNetCore.Hosting.WebHostExtensions

Methods

Run(Microsoft.AspNetCore.Hosting.IWebHost)

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

Arguments:host (Microsoft.AspNetCore.Hosting.IWebHost) – The Microsoft.AspNetCore.Hosting.IWebHost to run.
public static void Run(this IWebHost host)
Run(Microsoft.AspNetCore.Hosting.IWebHost, System.Threading.CancellationToken)

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

Arguments:
public static void Run(this IWebHost host, CancellationToken token)