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()
已淘汰.
已淘汰.

要求目前的應用程式終止。

適用於