HostingHostBuilderExtensions extension

on

Methods

runConsole([CancellationToken? cancellationToken]) Future<void>

Available on HostBuilder, provided by the HostingHostBuilderExtensions extension

Enables console support, builds and starts the host, and waits for Ctrl+C or SIGTERM to shut down.
useConsoleLifetime([void configure(ConsoleLifetimeOptions options)?]) HostBuilder

Available on HostBuilder, provided by the HostingHostBuilderExtensions extension

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

Static Methods

addDefaultServices(HostBuilderContext hostingContext, ServiceCollection services) → void

Available on HostBuilder, provided by the HostingHostBuilderExtensions extension

applyDefaultHostConfiguration(ConfigurationBuilder hostConfigBuilder, List<String>? args) → void

Available on HostBuilder, provided by the HostingHostBuilderExtensions extension

createDefaultServiceProviderOptions(HostBuilderContext context) ServiceProviderOptions

Available on HostBuilder, provided by the HostingHostBuilderExtensions extension