<PackageReference Include="Microsoft.Extensions.Hosting.Abstractions" Version="10.0.9" />

Microsoft.Extensions.Hosting.IHostBuilder

public interface IHostBuilder
A program initialization abstraction.
IDictionary<object, object> Properties { get; }

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

Runs the given actions to initialize the host. This can only be called once.

IHostBuilder ConfigureAppConfiguration(Action<HostBuilderContext, 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 Configuration for subsequent operations, as well as in Services.

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

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

IHostBuilder ConfigureHostConfiguration(Action<IConfigurationBuilder> configureDelegate)

Sets 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.

IHostBuilder ConfigureServices(Action<HostBuilderContext, IServiceCollection> configureDelegate)

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

IHostBuilder UseServiceProviderFactory<TContainerBuilder>(IServiceProviderFactory<TContainerBuilder> factory)

Overrides the factory used to create the service provider.

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

Overrides the factory used to create the service provider.