IApplicationLifetime 接口

定义

注意

This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.

注意

IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.

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

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

public interface class IApplicationLifetime
public interface IApplicationLifetime
[System.Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.", false)]
public interface IApplicationLifetime
[System.Obsolete("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.")]
public interface IApplicationLifetime
type IApplicationLifetime = interface
[<System.Obsolete("This type is obsolete and will be removed in a future version. The recommended alternative is Microsoft.Extensions.Hosting.IHostApplicationLifetime.", false)>]
type IApplicationLifetime = interface
[<System.Obsolete("IApplicationLifetime has been deprecated. Use Microsoft.Extensions.Hosting.IHostApplicationLifetime instead.")>]
type IApplicationLifetime = interface
Public Interface IApplicationLifetime
派生
属性

属性

ApplicationStarted
已过时.
已过时.

当应用程序主机已完全启动并即将等待正常关闭时触发。

ApplicationStopped
已过时.
已过时.

当应用程序主机执行正常关闭时触发。 所有请求都应在此时完成。 在此事件完成之前,关闭将被阻止。

ApplicationStopping
已过时.
已过时.

当应用程序主机执行正常关闭时触发。 请求可能仍在进行中。 在此事件完成之前,关闭将被阻止。

方法

StopApplication()
已过时.
已过时.

当前应用程序请求终止。

适用于