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.​IHostApplicationBuilder

Assembly: Microsoft.Extensions.Hosting.Abstractions

Represents a hosted applications and services builder which helps manage configuration, logging, lifetime, and more.

Properties

Gets the set of key/value configuration properties.
Remarks This can be mutated by adding more configuration sources, which will update its current view.
Environment
Gets the information about the hosting environment an application is running in.
Gets a collection of logging providers for the application to compose. This is useful for adding new logging providers.
Gets a builder that allows enabling metrics and directing their output.
Properties
Gets a central location for sharing state between components during the host building process.
Gets a collection of services for the application to compose. This is useful for adding user provided or framework provided services.

Methods

void
ConfigureContainer​(DependencyInjection.​IServiceProviderFactory<​TContainerBuilder> factory, System.​Action?<​TContainerBuilder> configure = null)
Registers a <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceProviderFactory`1" /> instance to be used to create the <see cref="T:System.IServiceProvider" /> .
factory The factory object that can create the <typeparamref name="TContainerBuilder" /> and <see cref="T:System.IServiceProvider" /> .
configure A delegate used to configure the <typeparamref name="TContainerBuilder" /> . This can be used to configure services using APIS specific to the <see cref="T:Microsoft.Extensions.DependencyInjection.IServiceProviderFactory`1" /> implementation.
Remarks <para> The <see cref="T:System.IServiceProvider" /> is created when this builder is built and so the delegate provided by <paramref name="configure" /> will run after all other services have been registered. </para> <para> Multiple calls to <see cref="M:Microsoft.Extensions.Hosting.IHostApplicationBuilder.ConfigureContainer``1(Microsoft.Extensions.DependencyInjection.IServiceProviderFactory{``0},System.Action{``0})" /> will replace the previously stored <paramref name="factory" /> and <paramref name="configure" /> delegate. </para>