Early Preview

This is currently very much a preview. Please feel free to try things out, but don't be upset if anything is not yet working. Feedback is welcome over on our GitHub Dicussions page.

interface Microsoft.​Extensions.​Hosting.​IHostBuilder

Assembly: Microsoft.Extensions.Hosting.Abstractions

A program initialization abstraction.

Properties

Properties
Gets a central location for sharing state between components during the host building process.

Methods

Build​()
Runs the given actions to initialize the host. This can only be called once.
Returns An initialized <see cref="T:Microsoft.Extensions.Hosting.IHost" /> .
ConfigureAppConfiguration​(System.​Action<​HostBuilderContext, Configuration.​IConfigurationBuilder> configureDelegate)
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 <see cref="P:Microsoft.Extensions.Hosting.HostBuilderContext.Configuration" /> for subsequent operations, as well as in <see cref="P:Microsoft.Extensions.Hosting.IHost.Services" /> .
Returns The same instance of the <see cref="T:Microsoft.Extensions.Hosting.IHostBuilder" /> for chaining.
configureDelegate The delegate for configuring the <see cref="T:Microsoft.Extensions.Configuration.IConfigurationBuilder" /> that will be used to construct the <see cref="T:Microsoft.Extensions.Configuration.IConfiguration" /> for the application.
ConfigureContainer​(System.​Action<​HostBuilderContext, TContainerBuilder> configureDelegate)
Enables configuring the instantiated dependency container. This can be called multiple times and the results will be additive.
Returns The same instance of the <see cref="T:Microsoft.Extensions.Hosting.IHostBuilder" /> for chaining.
configureDelegate The delegate which configures the builder.
ConfigureHostConfiguration​(System.​Action<​Configuration.​IConfigurationBuilder> configureDelegate)
Sets up the configuration for the builder itself. This will be used to initialize the <see cref="T:Microsoft.Extensions.Hosting.IHostEnvironment" /> for use later in the build process. This can be called multiple times and the results will be additive.
Returns The same instance of the <see cref="T:Microsoft.Extensions.Hosting.IHostBuilder" /> for chaining.
configureDelegate The delegate for configuring the <see cref="T:Microsoft.Extensions.Configuration.IConfigurationBuilder" /> that will be used to construct the <see cref="T:Microsoft.Extensions.Configuration.IConfiguration" /> for the host.
ConfigureServices​(System.​Action<​HostBuilderContext, DependencyInjection.​IServiceCollection> configureDelegate)
Adds services to the container. This can be called multiple times and the results will be additive.
Returns The same instance of the <see cref="T:Microsoft.Extensions.Hosting.IHostBuilder" /> for chaining.
configureDelegate The delegate for configuring the <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceCollection" /> that will be used to construct the <see cref="T:System.IServiceProvider" /> .
UseServiceProviderFactory​(DependencyInjection.​IServiceProviderFactory<​TContainerBuilder> factory)
Overrides the factory used to create the service provider.
Returns The same instance of the <see cref="T:Microsoft.Extensions.Hosting.IHostBuilder" /> for chaining.
factory The factory to register.
UseServiceProviderFactory​(System.​Func<​HostBuilderContext, DependencyInjection.​IServiceProviderFactory<​TContainerBuilder>> factory)
Overrides the factory used to create the service provider.
Returns The same instance of the <see cref="T:Microsoft.Extensions.Hosting.IHostBuilder" /> for chaining.
factory The factory to register.