Microsoft.Extensions.Hosting Namespace
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Provides classes that allow you to encapsulate an app's resources and lifetime functionality.
Classes
BackgroundService |
Base class for implementing a long running IHostedService. |
ConsoleLifetimeOptions | |
EnvironmentName |
Commonly used environment names. This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.Environments. |
Environments |
Commonly used environment names. |
Host |
Provides convenience methods for creating instances of IHostBuilder with preconfigured defaults. |
HostAbortedException |
The exception that is thrown upon IHost abortion. |
HostApplicationBuilder |
A builder for hosted applications and services that helps manage configuration, logging, lifetime, and more. |
HostApplicationBuilderSettings |
Contains the settings for constructing an HostApplicationBuilder. |
HostBuilder |
A program initialization utility. |
HostBuilderContext |
Context containing the common services on the IHost. Some properties may be null until set by the IHost. |
HostDefaults |
Constants for HostBuilder configuration keys. |
HostEnvironmentEnvExtensions |
Extension methods for IHostEnvironment. |
HostingAbstractionsHostBuilderExtensions | |
HostingAbstractionsHostExtensions | |
HostingEnvironmentExtensions |
Extension methods for IHostingEnvironment. |
HostingHostBuilderExtensions | |
HostOptions |
Options for IHost. |
SystemdHostBuilderExtensions |
Extension methods for setting up SystemdLifetime. |
WindowsServiceLifetimeHostBuilderExtensions |
Extension methods for setting up WindowsServiceLifetime. |
Interfaces
IApplicationLifetime |
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. |
IHost |
A program abstraction. |
IHostApplicationLifetime |
Allows consumers to be notified of application lifetime events. |
IHostBuilder |
A program initialization abstraction. |
IHostedService |
Defines methods for objects that are managed by the host. |
IHostEnvironment |
Provides information about the hosting environment an application is running in. |
IHostingEnvironment |
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. |
IHostLifetime |
Enums
BackgroundServiceExceptionBehavior |
Specifies a behavior that the IHost will honor if an unhandled exception occurs in one of its BackgroundService instances. |