다음을 통해 공유


HostingHostBuilderExtensions Class

Definition

Provides extension methods for the IHostBuilder from the hosting package.

public ref class HostingHostBuilderExtensions abstract sealed
public static class HostingHostBuilderExtensions
type HostingHostBuilderExtensions = class
Public Module HostingHostBuilderExtensions
Inheritance
HostingHostBuilderExtensions

Methods

ConfigureAppConfiguration(IHostBuilder, Action<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>(IHostBuilder, Action<TContainerBuilder>)

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

ConfigureDefaults(IHostBuilder, String[])

Configures an existing IHostBuilder instance with pre-configured defaults. This will overwrite previously configured values and is intended to be called before additional configuration calls.

ConfigureHostOptions(IHostBuilder, Action<HostBuilderContext,HostOptions>)

Adds a delegate for configuring the HostOptions of the IHost.

ConfigureHostOptions(IHostBuilder, Action<HostOptions>)

Adds a delegate for configuring the HostOptions of the IHost.

ConfigureLogging(IHostBuilder, Action<HostBuilderContext,ILoggingBuilder>)

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

ConfigureLogging(IHostBuilder, Action<ILoggingBuilder>)

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

ConfigureMetrics(IHostBuilder, Action<HostBuilderContext,IMetricsBuilder>)

Adds a delegate for configuring the provided IMetricsBuilder. This can be called multiple times.

ConfigureMetrics(IHostBuilder, Action<IMetricsBuilder>)

Adds a delegate for configuring the provided IMetricsBuilder. This can be called multiple times.

ConfigureServices(IHostBuilder, Action<IServiceCollection>)

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

RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)

Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down.

RunConsoleAsync(IHostBuilder, CancellationToken)

Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down.

UseConsoleLifetime(IHostBuilder, Action<ConsoleLifetimeOptions>)

Listens for Ctrl+C or SIGTERM and calls StopApplication() to start the shutdown process. This will unblock extensions like RunAsync and WaitForShutdownAsync.

UseConsoleLifetime(IHostBuilder)

Listens for Ctrl+C or SIGTERM and calls StopApplication() to start the shutdown process. This will unblock extensions like RunAsync and WaitForShutdownAsync.

UseContentRoot(IHostBuilder, String)

Specifies the content root directory to be used by the host. To avoid the content root directory being overwritten by a default value, ensure this is called after defaults are configured.

UseDefaultServiceProvider(IHostBuilder, Action<HostBuilderContext,ServiceProviderOptions>)

Specifies the IServiceProvider to be the default one.

UseDefaultServiceProvider(IHostBuilder, Action<ServiceProviderOptions>)

Specifies the IServiceProvider to be the default one.

UseEnvironment(IHostBuilder, String)

Specifies the environment to be used by the host. To avoid the environment being overwritten by a default value, ensure this is called after defaults are configured.

Applies to