Microsoft.Extensions.Hosting.Abstractions
Base class for implementing a long running .
Gets the Task that executes the background operation.
Will return if the background operation hasn't started.
This method is called when the starts. The implementation should return a task that represents
the lifetime of the long running operation(s) being performed.
Triggered when is called.
A that represents the long running operations.
See Worker Services in .NET for implementation guidelines.
Triggered when the application host is ready to start the service.
Indicates that the start process has been aborted.
A that represents the asynchronous Start operation.
Triggered when the application host is performing a graceful shutdown.
Indicates that the shutdown process should no longer be graceful.
A that represents the asynchronous Stop operation.
Commonly used environment names.
This type is obsolete and will be removed in a future version.
The recommended alternative is Microsoft.Extensions.Hosting.Environments.
The name of the Development environment.
The name of the Staging environment.
The name of the Production environment.
Commonly used environment names.
Specifies the Development environment.
The development environment can enable features that shouldn't be exposed in production. Because of the performance cost, scope validation and dependency validation only happens in development.
Specifies the Staging environment.
The staging environment can be used to validate app changes before changing the environment to production.
Specifies the Production environment.
The production environment should be configured to maximize security, performance, and application robustness.
The exception that is thrown when an is stopped to indicate the Host is stopping gracefully. This exception should not be thrown or handled by user code.
Initializes a new instance of the class
with a system-supplied error message.
Initializes a new instance of the class
with a specified error message.
The error message that explains the reason for the exception.
The content of is intended to be understood by humans.
The caller of this constructor is required to ensure that this string has been localized for the
current system culture.
Initializes a new instance of the class
with a specified error message and a reference to the inner exception that
is the cause of this exception.
The error message that explains the reason for the exception.
The exception that is the cause of the current exception.
The content of is intended to be understood by humans.
The caller of this constructor is required to ensure that this string has been localized for the
current system culture.
Context containing the common services on the . Some properties may be null until set by the .
Initializes a new instance of .
A non-null for sharing state between components during the host building process.
The initialized by the .
The containing the merged configuration of the application and the .
A central location for sharing state between components during the host building process.
Constants for HostBuilder configuration keys.
The configuration key used to set .
The configuration key used to set .
The configuration key used to set
and .
Extension methods for .
Checks if the current host environment name is .
An instance of .
if the environment name is , otherwise .
Checks if the current host environment name is .
An instance of .
if the environment name is , otherwise .
Checks if the current host environment name is .
An instance of .
if the environment name is , otherwise .
Compares the current host environment name against the specified value.
An instance of .
Environment name to validate against.
if the specified name is the same as the current environment, otherwise .
Provides extension methods for the from the hosting abstractions package.
Builds and starts the host.
The to start.
The started .
Builds and starts the host.
The to start.
A that can be used to cancel the start.
The started .
Provides extension methods for the from the hosting abstractions package.
Starts the host synchronously.
The to start.
Attempts to gracefully stop the host with the given timeout.
The to stop.
The timeout for stopping gracefully. Once expired the
server may terminate any remaining active connections.
The that represents the asynchronous operation.
Blocks the calling thread until shutdown is triggered via Ctrl+C or SIGTERM.
The running .
Runs an application and blocks the calling thread until host shutdown is triggered and all instances are stopped.
The to run.
Runs an application and returns a that only completes when the token is triggered or shutdown is triggered.
The instance is disposed of after running.
The to run.
The token to trigger shutdown.
The that represents the asynchronous operation.
Returns a Task that completes when shutdown is triggered via the given token.
The running .
The token to trigger shutdown.
The that represents the asynchronous operation.
Extension methods for .
Checks if the current hosting environment name is .
An instance of .
if the environment name is , otherwise .
Checks if the current hosting environment name is .
An instance of .
if the environment name is , otherwise .
Checks if the current hosting environment name is .
An instance of .
if the environment name is , otherwise .
Compares the current hosting environment name against the specified value.
An instance of .
Environment name to validate against.
if the specified name is the same as the current environment, otherwise .
Allows consumers to perform cleanup during a graceful shutdown.
This type is obsolete and will be removed in a future version.
The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.
Gets a cancellation token. Triggered when the application host has fully started and is about to wait
for a graceful shutdown.
Gets a cancellation token. Triggered when the application host is performing a graceful shutdown.
Requests may still be in flight. Shutdown will block until this event completes.
Gets a cancellation token. Triggered when the application host is performing a graceful shutdown.
All requests should be complete at this point. Shutdown will block
until this event completes.
Requests termination of the current application.
A program abstraction.
Gets the services configured for the program (for example, using ).
Starts the objects configured for the program.
The application will run until interrupted or until is called.
Used to abort program start.
A that will be completed when the starts.
Attempts to gracefully stop the program.
Used to indicate when stop should no longer be graceful.
A that will be completed when the stops.
Represents a hosted applications and services builder which helps manage configuration, logging, lifetime, and more.
Gets a central location for sharing state between components during the host building process.
Gets the set of key/value configuration properties.
This can be mutated by adding more configuration sources, which will update its current view.
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.
Gets a collection of services for the application to compose. This is useful for adding user provided or framework provided services.
Registers a instance to be used to create the .
The factory object that can create the and .
A delegate used to configure the . This can be used to configure services using
APIS specific to the implementation.
The type of builder provided by the .
The is created when this builder is built and so the delegate provided
by will run after all other services have been registered.
Multiple calls to will replace
the previously stored and delegate.
Allows consumers to be notified of application lifetime events. This interface is not intended to be user-replaceable.
Gets a cancellation token. Triggered when the application host has fully started.
Gets a cancellation token. Triggered when the application host is starting a graceful shutdown.
Shutdown will block until all callbacks registered on this token have completed.
Gets a cancellation token. Triggered when the application host has completed a graceful shutdown.
The application will not exit until all callbacks registered on this token have completed.
Requests termination of the current application.
A program initialization abstraction.
Gets a central location for sharing state between components during the host building process.
Sets up the configuration for the builder itself. This will be used to initialize the
for use later in the build process. This can be called multiple times and the results will be additive.
The delegate for configuring the that will be used
to construct the for the host.
The same instance of the for chaining.
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 for
subsequent operations, as well as in .
The delegate for configuring the that will be used
to construct the for the application.
The same instance of the for chaining.
Adds services to the container. This can be called multiple times and the results will be additive.
The delegate for configuring the that will be used
to construct the .
The same instance of the for chaining.
Overrides the factory used to create the service provider.
The type of builder.
The factory to register.
The same instance of the for chaining.
Overrides the factory used to create the service provider.
The type of builder.
The factory to register.
The same instance of the for chaining.
Enables configuring the instantiated dependency container. This can be called multiple times and
the results will be additive.
The type of builder.
The delegate which configures the builder.
The same instance of the for chaining.
Runs the given actions to initialize the host. This can only be called once.
An initialized .
Defines methods that are run before or after
and
.
Triggered before .
Indicates that the start process has been aborted.
A that represents the asynchronous operation.
Triggered after .
Indicates that the start process has been aborted.
A that represents the asynchronous operation.
Triggered before .
Indicates that the start process has been aborted.
A that represents the asynchronous operation.
Triggered after .
Indicates that the stop process has been aborted.
A that represents the asynchronous operation.
Defines methods for objects that are managed by the host.
Triggered when the application host is ready to start the service.
Indicates that the start process has been aborted.
A that represents the asynchronous Start operation.
Triggered when the application host is performing a graceful shutdown.
Indicates that the shutdown process should no longer be graceful.
A that represents the asynchronous Stop operation.
Provides information about the hosting environment an application is running in.
Gets or sets the name of the environment. The host automatically sets this property to the value of the
"environment" key as specified in configuration.
Gets or sets the name of the application. This property is automatically set by the host to the assembly containing
the application entry point.
Gets or sets the absolute path to the directory that contains the application content files.
Gets or sets an pointing at .
Provides information about the hosting environment an application is running in.
This type is obsolete and will be removed in a future version.
The recommended alternative is Microsoft.Extensions.Hosting.IHostEnvironment.
Gets or sets the name of the environment. The host automatically sets this property to the value of the
of the "environment" key as specified in configuration.
Gets or sets the name of the application. This property is automatically set by the host to the assembly containing
the application entry point.
Gets or sets the absolute path to the directory that contains the application content files.
Gets or sets an pointing at .
Tracks host lifetime.
Called at the start of which will wait until it's complete before
continuing. This can be used to delay startup until signaled by an external event.
Used to abort program start.
A .
Called from to indicate that the host is stopping and it's time to shut down.
Used to indicate when stop should no longer be graceful.
A .
Extension methods for adding hosted services to an .
Add an registration for the given type.
An to register.
The to register with.
The original .
Add an registration for the given type.
An to register.
The to register with.
A factory to create new instances of the service implementation.
The original .
The host was aborted.