IApplicationLifetime IApplicationLifetime Interface

Allows consumers to perform cleanup during a graceful shutdown.

Syntax

Declaration

public interface IApplicationLifetimePublic Interface IApplicationLifetime

Properties summary

Triggered when the application host has fully started and is about to wait for a graceful shutdown.
Triggered when the application host is performing a graceful shutdown. All requests should be complete at this point. Shutdown will block until this event completes.
Triggered when the application host is performing a graceful shutdown. Requests may still be in flight. Shutdown will block until this event completes.

Methods summary

Requests termination the current application.

Properties

  • ApplicationStarted
    ApplicationStarted
    Triggered when the application host has fully started and is about to wait for a graceful shutdown.
    CancellationToken ApplicationStarted { get; }ReadOnly Property ApplicationStarted As CancellationToken

    Property Value

    • System.Threading.CancellationToken
      System.Threading.CancellationToken
  • ApplicationStopped
    ApplicationStopped
    Triggered when the application host is performing a graceful shutdown. All requests should be complete at this point. Shutdown will block until this event completes.
    CancellationToken ApplicationStopped { get; }ReadOnly Property ApplicationStopped As CancellationToken

    Property Value

    • System.Threading.CancellationToken
      System.Threading.CancellationToken
  • ApplicationStopping
    ApplicationStopping
    Triggered when the application host is performing a graceful shutdown. Requests may still be in flight. Shutdown will block until this event completes.
    CancellationToken ApplicationStopping { get; }ReadOnly Property ApplicationStopping As CancellationToken

    Property Value

    • System.Threading.CancellationToken
      System.Threading.CancellationToken

Methods

  • StopApplication()
    StopApplication()
    Requests termination the current application.
    void StopApplication()Sub StopApplication

Details

Assembly

Microsoft.AspNetCore.Hosting.Abstractions.dll