ConsoleLifetime Class
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
This API supports the .NET infrastructure and is not intended to be used directly from your code.
Console |
Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host options and logger factory. |
Console |
Initializes a ConsoleLifetime instance using the specified console lifetime options, host environment, host application lifetime and host options. |
Dispose() |
Unregisters the shutdown handlers and disposes the application start and application stop registrations. |
Stop |
This method does nothing. |
Wait |
Registers the application start, application stop and shutdown handlers for this application. |
Product | Versions |
---|---|
.NET | 8 (package-provided), 9 (package-provided) |
.NET Framework | 4.7 (package-provided), 4.7.1 (package-provided), 4.7.2 (package-provided), 4.8 (package-provided) |
.NET Standard | 2.0 (package-provided), 2.1 (package-provided) |
.NET feedback
.NET is an open source project. Select a link to provide feedback: