WebHostBuilder Class

Definition

A builder for IWebHost

public class WebHostBuilder : Microsoft.AspNetCore.Hosting.IWebHostBuilder
Inheritance
WebHostBuilder
Implements

Constructors

WebHostBuilder()

Initializes a new instance of the WebHostBuilder class.

Methods

Build()

Builds the required services and an IWebHost which hosts a web application.

ConfigureAppConfiguration(Action<WebHostBuilderContext,IConfigurationBuilder>)

Adds a delegate for configuring the IConfigurationBuilder that will construct an IConfiguration.

ConfigureLogging(Action<ILoggerFactory>)

Adds a delegate for configuring the provided ILoggerFactory. This may be called multiple times.

ConfigureServices(Action<WebHostBuilderContext,IServiceCollection>)

Adds a delegate for configuring additional services for the host or web application. This may be called multiple times.

ConfigureServices(Action<IServiceCollection>)

Adds a delegate for configuring additional services for the host or web application. This may be called multiple times.

GetSetting(String)

Get the setting value from the configuration.

UseLoggerFactory(ILoggerFactory)

Specify the ILoggerFactory to be used by the web host.

UseSetting(String, String)

Add or replace a setting in the configuration.

Extension Methods

UseAzureAppServices(IWebHostBuilder)
CaptureStartupErrors(IWebHostBuilder, Boolean)
PreferHostingUrls(IWebHostBuilder, Boolean)
Start(IWebHostBuilder, String[])
UseConfiguration(IWebHostBuilder, IConfiguration)
UseContentRoot(IWebHostBuilder, String)
UseEnvironment(IWebHostBuilder, String)
UseServer(IWebHostBuilder, IServer)
UseShutdownTimeout(IWebHostBuilder, TimeSpan)
UseStartup(IWebHostBuilder, String)
UseUrls(IWebHostBuilder, String[])
UseWebRoot(IWebHostBuilder, String)
Configure(IWebHostBuilder, Action<IApplicationBuilder>)
ConfigureAppConfiguration(IWebHostBuilder, Action<IConfigurationBuilder>)
ConfigureLogging(IWebHostBuilder, Action<WebHostBuilderContext,ILoggingBuilder>)
ConfigureLogging(IWebHostBuilder, Action<ILoggingBuilder>)
UseDefaultServiceProvider(IWebHostBuilder, Action<WebHostBuilderContext,ServiceProviderOptions>)
UseDefaultServiceProvider(IWebHostBuilder, Action<ServiceProviderOptions>)
UseStartup(IWebHostBuilder, Type)
UseStartup<TStartup>(IWebHostBuilder)
UseHttpSys(IWebHostBuilder)
UseHttpSys(IWebHostBuilder, Action<HttpSysOptions>)
UseIISIntegration(IWebHostBuilder)
UseKestrel(IWebHostBuilder)
UseKestrel(IWebHostBuilder, Action<KestrelServerOptions>)
UseKestrel(IWebHostBuilder, Action<KestrelServerOptions>)
UseLibuv(IWebHostBuilder)
UseLibuv(IWebHostBuilder, Action<LibuvTransportOptions>)
UseWebListener(IWebHostBuilder)
UseWebListener(IWebHostBuilder, Action<WebListenerOptions>)