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. Triggered when the application host is ready to start the service. Indicates that the start process has been aborted. Triggered when the application host is performing a graceful shutdown. Indicates that the shutdown process should no longer be graceful. Commonly used environment names. This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.Environments. Commonly used environment names. Context containing the common services on the . Some properties may be null until set by the . 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 . True if the environment name is , otherwise false. Checks if the current host environment name is . An instance of . True if the environment name is , otherwise false. Checks if the current host environment name is . An instance of . True if the environment name is , otherwise false. Compares the current host environment name against the specified value. An instance of . Environment name to validate against. True if the specified name is the same as the current environment, otherwise false. 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 . 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. Block the calling thread until shutdown is triggered via Ctrl+C or SIGTERM. The running . Runs an application and block the calling thread until host shutdown. 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 . True if the environment name is , otherwise false. Checks if the current hosting environment name is . An instance of . True if the environment name is , otherwise false. Checks if the current hosting environment name is . An instance of . True if the environment name is , otherwise false. Compares the current hosting environment name against the specified value. An instance of . Environment name to validate against. True if the specified name is the same as the current environment, otherwise false. 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. Triggered when the application host has fully started and is about to wait for a graceful shutdown. Triggered when the application host is performing a graceful shutdown. Requests may still be in flight. Shutdown will block until this event completes. 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. The programs configured services. Start the program. 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. Allows consumers to be notified of application lifetime events. This interface is not intended to be user-replaceable. Triggered when the application host has fully started. Triggered when the application host is starting a graceful shutdown. Shutdown will block until all callbacks registered on this token have completed. 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. A central location for sharing state between components during the host building process. Set 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 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. Run the given actions to initialize the host. This can only be called once. An initialized . 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. Triggered when the application host is performing a graceful shutdown. Indicates that the shutdown process should no longer be graceful. 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 . 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 . 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 . Indicates that certain members on a specified are accessed dynamically, for example through . This allows tools to understand which members are being accessed during the execution of a program. This attribute is valid on members whose type is or . When this attribute is applied to a location of type , the assumption is that the string represents a fully qualified type name. When this attribute is applied to a class, interface, or struct, the members specified can be accessed dynamically on instances returned from calling on instances of that class, interface, or struct. If the attribute is applied to a method it's treated as a special case and it implies the attribute should be applied to the "this" parameter of the method. As such the attribute should only be used on instance methods of types assignable to System.Type (or string, but no methods will use it there). Initializes a new instance of the class with the specified member types. The types of members dynamically accessed. Gets the which specifies the type of members dynamically accessed. Specifies the types of members that are dynamically accessed. This enumeration has a attribute that allows a bitwise combination of its member values. Specifies no members. Specifies the default, parameterless public constructor. Specifies all public constructors. Specifies all non-public constructors. Specifies all public methods. Specifies all non-public methods. Specifies all public fields. Specifies all non-public fields. Specifies all public nested types. Specifies all non-public nested types. Specifies all public properties. Specifies all non-public properties. Specifies all public events. Specifies all non-public events. Specifies all interfaces implemented by the type. Specifies all members.