Early Preview
This is currently very much a preview. Please feel free to try things out,
but don't be upset if anything is not yet working. Feedback is welcome over on our
GitHub Dicussions page.
interface Microsoft.​Extensions.​Hosting.​IHostApplicationLifetime
Assembly: Microsoft.Extensions.Hosting.Abstractions
Allows consumers to be notified of application lifetime events. This interface is not intended to be user-replaceable.
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
void
StopApplication​()
Requests termination of the current application.