ConsoleLifetime Class
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Listens for Ctrl+C or SIGTERM and initiates shutdown.
public ref class ConsoleLifetime : IDisposable, Microsoft::Extensions::Hosting::IHostLifetime
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public class ConsoleLifetime : IDisposable, Microsoft.Extensions.Hosting.IHostLifetime
public class ConsoleLifetime : IDisposable, Microsoft.Extensions.Hosting.IHostLifetime
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
type ConsoleLifetime = class
interface IHostLifetime
interface IDisposable
type ConsoleLifetime = class
interface IHostLifetime
interface IDisposable
Public Class ConsoleLifetime
Implements IDisposable, IHostLifetime
- Inheritance
-
ConsoleLifetime
- Attributes
- Implements
Remarks
This API supports the .NET infrastructure and is not intended to be used directly from your code.
Constructors
ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>, ILoggerFactory) |
Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host options and logger factory. |
ConsoleLifetime(IOptions<ConsoleLifetimeOptions>, IHostEnvironment, IHostApplicationLifetime, IOptions<HostOptions>) |
Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host application lifetime and host options. |
Methods
Dispose() |
Unregisters the shutdown handlers and disposes the application start and application stop registrations. |
StopAsync(CancellationToken) |
This method does nothing. |
WaitForStartAsync(CancellationToken) |
Registers the application start, application stop and shutdown handlers for this application. |
Applies to
.NET