Sdílet prostřednictvím


HostingHostBuilderExtensions.UseConsoleLifetime Metoda

Definice

Přetížení

UseConsoleLifetime(IHostBuilder)

Naslouchá klávesám Ctrl+C nebo SIGTERM a volá StopApplication() spuštění procesu vypnutí. Tím se odblokují rozšíření, jako jsou RunAsync a WaitForShutdownAsync.

UseConsoleLifetime(IHostBuilder, Action<ConsoleLifetimeOptions>)

Naslouchá klávesám Ctrl+C nebo SIGTERM a volá StopApplication() spuštění procesu vypnutí. Tím se odblokují rozšíření, jako jsou RunAsync a WaitForShutdownAsync.

UseConsoleLifetime(IHostBuilder)

Zdroj:
HostingHostBuilderExtensions.cs
Zdroj:
HostingHostBuilderExtensions.cs

Naslouchá klávesám Ctrl+C nebo SIGTERM a volá StopApplication() spuštění procesu vypnutí. Tím se odblokují rozšíření, jako jsou RunAsync a WaitForShutdownAsync.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseConsoleLifetime(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder);
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder);
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder -> Microsoft.Extensions.Hosting.IHostBuilder
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function UseConsoleLifetime (hostBuilder As IHostBuilder) As IHostBuilder

Parametry

hostBuilder
IHostBuilder

Konfigurace IHostBuilder .

Návraty

Stejná instance IHostBuilder pro řetězení.

Atributy

Platí pro

UseConsoleLifetime(IHostBuilder, Action<ConsoleLifetimeOptions>)

Zdroj:
HostingHostBuilderExtensions.cs
Zdroj:
HostingHostBuilderExtensions.cs

Naslouchá klávesám Ctrl+C nebo SIGTERM a volá StopApplication() spuštění procesu vypnutí. Tím se odblokují rozšíření, jako jsou RunAsync a WaitForShutdownAsync.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseConsoleLifetime(Microsoft::Extensions::Hosting::IHostBuilder ^ hostBuilder, Action<Microsoft::Extensions::Hosting::ConsoleLifetimeOptions ^> ^ configureOptions);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions);
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions);
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> -> Microsoft.Extensions.Hosting.IHostBuilder
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> -> Microsoft.Extensions.Hosting.IHostBuilder
<Extension()>
Public Function UseConsoleLifetime (hostBuilder As IHostBuilder, configureOptions As Action(Of ConsoleLifetimeOptions)) As IHostBuilder

Parametry

hostBuilder
IHostBuilder

Konfigurace IHostBuilder .

configureOptions
Action<ConsoleLifetimeOptions>

Delegát pro konfiguraci .ConsoleLifetime

Návraty

Stejná instance IHostBuilder pro řetězení.

Atributy

Platí pro