WebHostBuilderExtensions Class

Definition

Contains extensions for configuring an IWebHostBuilder.

C#
public static class WebHostBuilderExtensions
Inheritance
WebHostBuilderExtensions

Methods

Configure(IWebHostBuilder, Action<IApplicationBuilder>)

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

Configure(IWebHostBuilder, Action<WebHostBuilderContext,IApplicationBuilder>)

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

ConfigureAppConfiguration(IWebHostBuilder, Action<IConfigurationBuilder>)

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

ConfigureLogging(IWebHostBuilder, Action<ILoggingBuilder>)

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

ConfigureLogging(IWebHostBuilder, Action<WebHostBuilderContext,ILoggingBuilder>)

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

UseDefaultServiceProvider(IWebHostBuilder, Action<ServiceProviderOptions>)

Configures the default service provider

UseDefaultServiceProvider(IWebHostBuilder, Action<WebHostBuilderContext,ServiceProviderOptions>)

Configures the default service provider

UseStartup(IWebHostBuilder, Type)

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

UseStartup<TStartup>(IWebHostBuilder, Func<WebHostBuilderContext,TStartup>)

Specify a factory that creates the startup instance to be used by the web host.

UseStartup<TStartup>(IWebHostBuilder)

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

UseStaticWebAssets(IWebHostBuilder)

Configures the WebRootFileProvider to use static web assets defined by referenced projects and packages.

Applies to

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