HostingHostBuilderExtensions.UseConsoleLifetime Methode

Definition

Überlädt

UseConsoleLifetime(IHostBuilder)

Lauscht auf STRG+C oder SIGTERM und ruft StopApplication() auf, um das Herunterfahren zu beginnen. Dies hebt die Blockierung von Erweiterungen wie RunAsync und WaitForShutdownAsync auf.

UseConsoleLifetime(IHostBuilder, Action<ConsoleLifetimeOptions>)

Lauscht auf STRG+C oder SIGTERM und ruft StopApplication() auf, um das Herunterfahren zu beginnen. Dies hebt die Blockierung von Erweiterungen wie RunAsync und WaitForShutdownAsync auf.

UseConsoleLifetime(IHostBuilder)

Quelle:
HostingHostBuilderExtensions.cs
Quelle:
HostingHostBuilderExtensions.cs
Quelle:
HostingHostBuilderExtensions.cs
Quelle:
HostingHostBuilderExtensions.cs

Lauscht auf STRG+C oder SIGTERM und ruft StopApplication() auf, um das Herunterfahren zu beginnen. Dies hebt die Blockierung von Erweiterungen wie RunAsync und WaitForShutdownAsync auf.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseConsoleLifetime(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")]
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder);
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder -> Microsoft.Extensions.Hosting.IHostBuilder
[<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
<Extension()>
Public Function UseConsoleLifetime (hostBuilder As IHostBuilder) As IHostBuilder

Parameter

hostBuilder
IHostBuilder

Die zu konfigurierende IHostBuilder-Schnittstelle.

Gibt zurück

Die gleiche Instanz der IHostBuilder-Schnittstelle für die Verkettung.

Attribute

Gilt für:

UseConsoleLifetime(IHostBuilder, Action<ConsoleLifetimeOptions>)

Quelle:
HostingHostBuilderExtensions.cs
Quelle:
HostingHostBuilderExtensions.cs
Quelle:
HostingHostBuilderExtensions.cs
Quelle:
HostingHostBuilderExtensions.cs

Lauscht auf STRG+C oder SIGTERM und ruft StopApplication() auf, um das Herunterfahren zu beginnen. Dies hebt die Blockierung von Erweiterungen wie RunAsync und WaitForShutdownAsync auf.

public:
[System::Runtime::CompilerServices::Extension]
 static Microsoft::Extensions::Hosting::IHostBuilder ^ UseConsoleLifetime(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")]
public static Microsoft.Extensions.Hosting.IHostBuilder UseConsoleLifetime (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions);
static member UseConsoleLifetime : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> -> Microsoft.Extensions.Hosting.IHostBuilder
[<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
<Extension()>
Public Function UseConsoleLifetime (hostBuilder As IHostBuilder, configureOptions As Action(Of ConsoleLifetimeOptions)) As IHostBuilder

Parameter

hostBuilder
IHostBuilder

Die zu konfigurierende IHostBuilder-Schnittstelle.

configureOptions
Action<ConsoleLifetimeOptions>

Der Delegat zum Konfigurieren von ConsoleLifetime.

Gibt zurück

Die gleiche Instanz der IHostBuilder-Schnittstelle für die Verkettung.

Attribute

Gilt für: