Leggi in inglese

Condividi tramite


IHostApplicationLifetime Interface

Definition

Allows consumers to be notified of application lifetime events. This interface is not intended to be user-replaceable.

C#
public interface IHostApplicationLifetime
Derived

Properties

ApplicationStarted

Gets a cancellation token. Triggered when the application host has fully started.

ApplicationStopped

Gets a cancellation token. Triggered when the application host has completed a graceful shutdown. The application will not exit until all callbacks registered on this token have completed.

ApplicationStopping

Gets a cancellation token. Triggered when the application host is starting a graceful shutdown. Shutdown will block until all callbacks registered on this token have completed.

Methods

StopApplication()

Requests termination of the current application.

Applies to

Prodotto Versioni
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)