Microsoft.Extensions.Hosting 命名空间

提供类,使你能够封装应用的资源和生存期功能。

BackgroundService

用于实现长时间运行的 IHostedService 的基类。

ConsoleLifetimeOptions

为 提供选项标志 ConsoleLifetime

EnvironmentName

常用的环境名称。

此类型已过时,并将从未来版本中删除。 建议的替代项为 Microsoft.Extensions.Hosting.Environments。

Environments

常用的环境名称。

Host

提供用于创建具有预配置默认值的 实例 IHostBuilder 的便捷方法。

HostAbortedException

堕胎时 IHost 引发的例外。

HostApplicationBuilder

托管应用程序和服务的生成器,可帮助管理配置、日志记录、生存期等。

HostApplicationBuilderSettings

包含用于构造 的设置 HostApplicationBuilder

HostBuilder

程序初始化实用工具。

HostBuilderContext

包含 IHost 上的公共服务的上下文。 某些属性在由 IHost 设置之前可能为 null。

HostDefaults

HostBuilder 配置键的常数。

HostEnvironmentEnvExtensions

IHostEnvironment 的扩展方法。

HostingAbstractionsHostBuilderExtensions

为宿主抽象包中的 提供扩展方法 IHostBuilder

HostingAbstractionsHostExtensions

为宿主抽象包中的 提供扩展方法 IHost

HostingEnvironmentExtensions

IHostingEnvironment 的扩展方法。

HostingHostBuilderExtensions

为托管包中的 提供扩展方法 IHostBuilder

HostOptions

的选项 IHost

SystemdHostBuilderExtensions

用于设置 SystemdLifetime 的扩展方法。

WindowsServiceLifetimeHostBuilderExtensions

用于设置 WindowsServiceLifetime 的扩展方法。

接口

IApplicationLifetime

允许使用者在正常关闭过程中执行清理。

此类型已过时,并将从未来版本中删除。 建议的替代项为 Microsoft.Extensions.Hosting.IHostApplicationLifetime。

IHost

程序抽象。

IHostApplicationBuilder

表示帮助管理配置、日志记录和生存期的托管应用程序和服务生成器。

IHostApplicationLifetime

允许通知使用者应用程序生存期事件。

IHostBuilder

程序初始化抽象。

IHostedLifecycleService

定义在 和 StopAsync(CancellationToken)之前或之后StartAsync(CancellationToken)运行的方法。

IHostedService

为主机所管理的对象定义方法。

IHostEnvironment

提供有关其中正在运行应用程序的宿主环境的信息。

IHostingEnvironment

提供有关其中正在运行应用程序的宿主环境的信息。

此类型已过时,并将从未来版本中删除。 建议的替代项为 Microsoft.Extensions.Hosting.IHostEnvironment。

IHostLifetime

跟踪主机生存期。

枚举

BackgroundServiceExceptionBehavior

指定在其实例之BackgroundService一中发生未经处理的异常时将遵循的行为IHost