Share via


ConfigureHostBuilder Class

Definition

A non-buildable IHostBuilder for WebApplicationBuilder. Use Build() to build the WebApplicationBuilder.

public sealed class ConfigureHostBuilder : Microsoft.AspNetCore.Hosting.Infrastructure.ISupportsConfigureWebHost, Microsoft.Extensions.Hosting.IHostBuilder
type ConfigureHostBuilder = class
    interface IHostBuilder
    interface ISupportsConfigureWebHost
Public NotInheritable Class ConfigureHostBuilder
Implements IHostBuilder, ISupportsConfigureWebHost
Inheritance
ConfigureHostBuilder
Implements

Properties

Properties

A central location for sharing state between components during the host building process.

Methods

ConfigureAppConfiguration(Action<HostBuilderContext,IConfigurationBuilder>)

Sets up the configuration for the remainder of the build process and application. This can be called multiple times and the results will be additive. The results will be available at Configuration for subsequent operations, as well as in Services.

ConfigureContainer<TContainerBuilder>(Action<HostBuilderContext,TContainerBuilder>)

Enables configuring the instantiated dependency container. This can be called multiple times and the results will be additive.

ConfigureHostConfiguration(Action<IConfigurationBuilder>)

Set up the configuration for the builder itself. This will be used to initialize the IHostEnvironment for use later in the build process. This can be called multiple times and the results will be additive.

ConfigureServices(Action<HostBuilderContext,IServiceCollection>)

Adds services to the container. This can be called multiple times and the results will be additive.

UseServiceProviderFactory<TContainerBuilder>(Func<HostBuilderContext,IServiceProviderFactory<TContainerBuilder>>)

Overrides the factory used to create the service provider.

UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder>)

Overrides the factory used to create the service provider.

Explicit Interface Implementations

IHostBuilder.Build()
ISupportsConfigureWebHost.ConfigureWebHost(Action<IWebHostBuilder>, Action<WebHostBuilderOptions>)

Applies to