Note

Access to this page requires authorization. You can try signing in or .

Access to this page requires authorization. You can try .

WebHost Class

Definition

Namespace:
Microsoft.AspNetCore
Assembly:
Microsoft.AspNetCore.dll
Package:
Microsoft.AspNetCore.App.Ref v10.0.0
Package:
Microsoft.AspNetCore.App.Ref v11.0.0-preview.4.26230.115
Package:
Microsoft.AspNetCore v2.0.0
Package:
Microsoft.AspNetCore v2.1.0
Package:
Microsoft.AspNetCore v2.2.0
Package:
Microsoft.AspNetCore.App.Ref v3.0.1
Package:
Microsoft.AspNetCore.App.Ref v3.1.10
Package:
Microsoft.AspNetCore.App.Ref v5.0.0
Package:
Microsoft.AspNetCore.App.Ref v6.0.36
Package:
Microsoft.AspNetCore.App.Ref v7.0.5
Package:
Microsoft.AspNetCore.App.Ref v8.0.19
Package:
Microsoft.AspNetCore.App.Ref v9.0.8
Source:
WebHost.cs
Source:
WebHost.cs
Source:
WebHost.cs

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.

Caution

WebHost is obsolete. Use HostBuilder or WebApplicationBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.

Provides convenience methods for creating instances of IWebHost and IWebHostBuilder with pre-configured defaults.

public ref class WebHost abstract sealed
[System.Obsolete("WebHost is obsolete. Use HostBuilder or WebApplicationBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId="ASPDEPR008", UrlFormat="https://aka.ms/aspnet/deprecate/008")]
public static class WebHost
public static class WebHost
[<System.Obsolete("WebHost is obsolete. Use HostBuilder or WebApplicationBuilder instead. For more information, visit https://aka.ms/aspnet/deprecate/008.", DiagnosticId="ASPDEPR008", UrlFormat="https://aka.ms/aspnet/deprecate/008")>]
type WebHost = class
type WebHost = class
Public Class WebHost
Inheritance
WebHost
Attributes

Methods

Name Description
CreateDefaultBuilder()

Initializes a new instance of the WebHostBuilder class with pre-configured defaults.

CreateDefaultBuilder(String[])

Initializes a new instance of the WebHostBuilder class with pre-configured defaults.

CreateDefaultBuilder<TStartup>(String[])

Initializes a new instance of the WebHostBuilder class with pre-configured defaults using typed Startup.

Start(Action<IRouteBuilder>)

Initializes and starts a new IWebHost with pre-configured defaults. See CreateDefaultBuilder() for details.

Start(RequestDelegate)

Initializes and starts a new IWebHost with pre-configured defaults. See CreateDefaultBuilder() for details.

Start(String, Action<IRouteBuilder>)

Initializes and starts a new IWebHost with pre-configured defaults. See CreateDefaultBuilder() for details.

Start(String, RequestDelegate)

Initializes and starts a new IWebHost with pre-configured defaults. See CreateDefaultBuilder() for details.

StartWith(Action<IApplicationBuilder>)

Initializes and starts a new IWebHost with pre-configured defaults. See CreateDefaultBuilder() for details.

StartWith(String, Action<IApplicationBuilder>)

Initializes and starts a new IWebHost with pre-configured defaults. See CreateDefaultBuilder() for details.

Applies to


Feedback

Was this page helpful?