IWebHostBuilder IWebHostBuilder IWebHostBuilder Interface

Definition

A builder for IWebHost.

public interface IWebHostBuilder
type IWebHostBuilder = interface
Public Interface IWebHostBuilder
Derived

Methods

Build() Build() Build()

Builds an IWebHost which hosts a web application.

ConfigureAppConfiguration(Action<WebHostBuilderContext,IConfigurationBuilder>) ConfigureAppConfiguration(Action<WebHostBuilderContext,IConfigurationBuilder>) ConfigureAppConfiguration(Action<WebHostBuilderContext,IConfigurationBuilder>)

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

ConfigureLogging(Action<ILoggerFactory>) ConfigureLogging(Action<ILoggerFactory>) ConfigureLogging(Action<ILoggerFactory>)

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

ConfigureServices(Action<WebHostBuilderContext,IServiceCollection>) ConfigureServices(Action<WebHostBuilderContext,IServiceCollection>) 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>) ConfigureServices(Action<IServiceCollection>) ConfigureServices(Action<IServiceCollection>)

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

GetSetting(String) GetSetting(String) GetSetting(String)

Get the setting value from the configuration.

UseLoggerFactory(ILoggerFactory) UseLoggerFactory(ILoggerFactory) UseLoggerFactory(ILoggerFactory)

Specify the ILoggerFactory to be used by the web host.

UseSetting(String, String) UseSetting(String, String) UseSetting(String, String)

Add or replace a setting in the configuration.

Extension Methods

UseAzureAppServices(IWebHostBuilder) UseAzureAppServices(IWebHostBuilder) UseAzureAppServices(IWebHostBuilder)

Configures application to use Azure AppServices integration.

CaptureStartupErrors(IWebHostBuilder, Boolean) CaptureStartupErrors(IWebHostBuilder, Boolean) CaptureStartupErrors(IWebHostBuilder, Boolean)

Set whether startup errors should be captured in the configuration settings of the web host. When enabled, startup exceptions will be caught and an error page will be returned. If disabled, startup exceptions will be propagated.

PreferHostingUrls(IWebHostBuilder, Boolean) PreferHostingUrls(IWebHostBuilder, Boolean) PreferHostingUrls(IWebHostBuilder, Boolean)

Indicate whether the host should listen on the URLs configured on the IWebHostBuilder instead of those configured on the IServer.

Start(IWebHostBuilder, String[]) Start(IWebHostBuilder, String[]) Start(IWebHostBuilder, String[])

Start the web host and listen on the specified urls.

SuppressStatusMessages(IWebHostBuilder, Boolean) SuppressStatusMessages(IWebHostBuilder, Boolean) SuppressStatusMessages(IWebHostBuilder, Boolean)

Specify if startup status messages should be suppressed.

UseConfiguration(IWebHostBuilder, IConfiguration) UseConfiguration(IWebHostBuilder, IConfiguration) UseConfiguration(IWebHostBuilder, IConfiguration)

Use the given configuration settings on the web host.

UseContentRoot(IWebHostBuilder, String) UseContentRoot(IWebHostBuilder, String) UseContentRoot(IWebHostBuilder, String)

Specify the content root directory to be used by the web host.

UseEnvironment(IWebHostBuilder, String) UseEnvironment(IWebHostBuilder, String) UseEnvironment(IWebHostBuilder, String)

Specify the environment to be used by the web host.

UseServer(IWebHostBuilder, IServer) UseServer(IWebHostBuilder, IServer) UseServer(IWebHostBuilder, IServer)

Specify the server to be used by the web host.

UseShutdownTimeout(IWebHostBuilder, TimeSpan) UseShutdownTimeout(IWebHostBuilder, TimeSpan) UseShutdownTimeout(IWebHostBuilder, TimeSpan)

Specify the amount of time to wait for the web host to shutdown.

UseStartup(IWebHostBuilder, String) UseStartup(IWebHostBuilder, String) UseStartup(IWebHostBuilder, String)

Specify the assembly containing the startup type to be used by the web host.

UseUrls(IWebHostBuilder, String[]) UseUrls(IWebHostBuilder, String[]) UseUrls(IWebHostBuilder, String[])

Specify the urls the web host will listen on.

UseWebRoot(IWebHostBuilder, String) UseWebRoot(IWebHostBuilder, String) UseWebRoot(IWebHostBuilder, String)

Specify the webroot directory to be used by the web host.

Configure(IWebHostBuilder, Action<IApplicationBuilder>) Configure(IWebHostBuilder, Action<IApplicationBuilder>) Configure(IWebHostBuilder, Action<IApplicationBuilder>)

Specify the startup method to be used to configure the web application.

ConfigureAppConfiguration(IWebHostBuilder, Action<IConfigurationBuilder>) ConfigureAppConfiguration(IWebHostBuilder, Action<IConfigurationBuilder>) ConfigureAppConfiguration(IWebHostBuilder, Action<IConfigurationBuilder>)

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

ConfigureLogging(IWebHostBuilder, Action<WebHostBuilderContext,ILoggingBuilder>) ConfigureLogging(IWebHostBuilder, Action<WebHostBuilderContext,ILoggingBuilder>) ConfigureLogging(IWebHostBuilder, Action<WebHostBuilderContext,ILoggingBuilder>)

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

ConfigureLogging(IWebHostBuilder, Action<ILoggingBuilder>) ConfigureLogging(IWebHostBuilder, Action<ILoggingBuilder>) ConfigureLogging(IWebHostBuilder, Action<ILoggingBuilder>)

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

UseDefaultServiceProvider(IWebHostBuilder, Action<WebHostBuilderContext,ServiceProviderOptions>) UseDefaultServiceProvider(IWebHostBuilder, Action<WebHostBuilderContext,ServiceProviderOptions>) UseDefaultServiceProvider(IWebHostBuilder, Action<WebHostBuilderContext,ServiceProviderOptions>)

Configures the default service provider

UseDefaultServiceProvider(IWebHostBuilder, Action<ServiceProviderOptions>) UseDefaultServiceProvider(IWebHostBuilder, Action<ServiceProviderOptions>) UseDefaultServiceProvider(IWebHostBuilder, Action<ServiceProviderOptions>)

Configures the default service provider

UseStartup(IWebHostBuilder, Type) UseStartup(IWebHostBuilder, Type) UseStartup(IWebHostBuilder, Type)

Specify the startup type to be used by the web host.

UseStartup<TStartup>(IWebHostBuilder) UseStartup<TStartup>(IWebHostBuilder) UseStartup<TStartup>(IWebHostBuilder)

Specify the startup type to be used by the web host.

UseHttpSys(IWebHostBuilder) UseHttpSys(IWebHostBuilder) UseHttpSys(IWebHostBuilder)

Specify HttpSys as the server to be used by the web host.

UseHttpSys(IWebHostBuilder, Action<HttpSysOptions>) UseHttpSys(IWebHostBuilder, Action<HttpSysOptions>) UseHttpSys(IWebHostBuilder, Action<HttpSysOptions>)

Specify HttpSys as the server to be used by the web host.

UseIISIntegration(IWebHostBuilder) UseIISIntegration(IWebHostBuilder) UseIISIntegration(IWebHostBuilder)

Configures the port and base path the server should listen on when running behind AspNetCoreModule. The app will also be configured to capture startup errors.

UseKestrel(IWebHostBuilder) UseKestrel(IWebHostBuilder) UseKestrel(IWebHostBuilder)

Specify Kestrel as the server to be used by the web host.

UseKestrel(IWebHostBuilder, Action<WebHostBuilderContext,KestrelServerOptions>) UseKestrel(IWebHostBuilder, Action<WebHostBuilderContext,KestrelServerOptions>) UseKestrel(IWebHostBuilder, Action<WebHostBuilderContext,KestrelServerOptions>)

Specify Kestrel as the server to be used by the web host.

UseKestrel(IWebHostBuilder, Action<KestrelServerOptions>) UseKestrel(IWebHostBuilder, Action<KestrelServerOptions>) UseKestrel(IWebHostBuilder, Action<KestrelServerOptions>)

Specify Kestrel as the server to be used by the web host.

UseKestrel(IWebHostBuilder, Action<KestrelServerOptions>) UseKestrel(IWebHostBuilder, Action<KestrelServerOptions>) UseKestrel(IWebHostBuilder, Action<KestrelServerOptions>)

Specify Kestrel as the server to be used by the web host.

UseLibuv(IWebHostBuilder) UseLibuv(IWebHostBuilder) UseLibuv(IWebHostBuilder)

Specify Libuv as the transport to be used by Kestrel.

UseLibuv(IWebHostBuilder, Action<LibuvTransportOptions>) UseLibuv(IWebHostBuilder, Action<LibuvTransportOptions>) UseLibuv(IWebHostBuilder, Action<LibuvTransportOptions>)

Specify Libuv as the transport to be used by Kestrel.

UseSockets(IWebHostBuilder) UseSockets(IWebHostBuilder) UseSockets(IWebHostBuilder)

Specify Sockets as the transport to be used by Kestrel.

UseSockets(IWebHostBuilder, Action<SocketTransportOptions>) UseSockets(IWebHostBuilder, Action<SocketTransportOptions>) UseSockets(IWebHostBuilder, Action<SocketTransportOptions>)

Specify Sockets as the transport to be used by Kestrel.

UseWebListener(IWebHostBuilder) UseWebListener(IWebHostBuilder) UseWebListener(IWebHostBuilder)

Specify WebListener as the server to be used by the web host.

UseWebListener(IWebHostBuilder, Action<WebListenerOptions>) UseWebListener(IWebHostBuilder, Action<WebListenerOptions>) UseWebListener(IWebHostBuilder, Action<WebListenerOptions>)

Specify WebListener as the server to be used by the web host.

ConfigureTestContainer<TContainer>(IWebHostBuilder, Action<TContainer>) ConfigureTestContainer<TContainer>(IWebHostBuilder, Action<TContainer>) ConfigureTestContainer<TContainer>(IWebHostBuilder, Action<TContainer>)
ConfigureTestServices(IWebHostBuilder, Action<IServiceCollection>) ConfigureTestServices(IWebHostBuilder, Action<IServiceCollection>) ConfigureTestServices(IWebHostBuilder, Action<IServiceCollection>)
UseSolutionRelativeContentRoot(IWebHostBuilder, String, String) UseSolutionRelativeContentRoot(IWebHostBuilder, String, String) UseSolutionRelativeContentRoot(IWebHostBuilder, String, String)
UseSolutionRelativeContentRoot(IWebHostBuilder, String, String, String) UseSolutionRelativeContentRoot(IWebHostBuilder, String, String, String) UseSolutionRelativeContentRoot(IWebHostBuilder, String, String, String)

Applies to