WebHostExtensions.Run Method
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.
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. |
- Source:
- WebHostExtensions.cs
- Source:
- WebHostExtensions.cs
- Source:
- WebHostExtensions.cs
Runs a web application and block the calling thread until host shutdown.
public:
[System::Runtime::CompilerServices::Extension]
static void Run(Microsoft::AspNetCore::Hosting::IWebHost ^ host);
C#
public static void Run (this Microsoft.AspNetCore.Hosting.IWebHost host);
static member Run : Microsoft.AspNetCore.Hosting.IWebHost -> unit
<Extension()>
Public Sub Run (host As IWebHost)
Parameters
Applies to
ASP.NET Core 9.0 and other versions
Product | Versions |
---|---|
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 |
Runs a web application and block the calling thread until token is triggered or shutdown is triggered.
public:
[System::Runtime::CompilerServices::Extension]
static void Run(Microsoft::AspNetCore::Hosting::IWebHost ^ host, System::Threading::CancellationToken token);
C#
public static void Run (this Microsoft.AspNetCore.Hosting.IWebHost host, System.Threading.CancellationToken token);
static member Run : Microsoft.AspNetCore.Hosting.IWebHost * System.Threading.CancellationToken -> unit
<Extension()>
Public Sub Run (host As IWebHost, token As CancellationToken)
Parameters
- token
- CancellationToken
The token to trigger shutdown.
Applies to
ASP.NET Core 1.1 and ASP.NET Core 1.0
Product | Versions |
---|---|
ASP.NET Core | 1.0, 1.1 |