HostingHostBuilderExtensions.RunConsoleAsync Methode
Definition
Wichtig
Einige Informationen beziehen sich auf Vorabversionen, die vor dem Release ggf. grundlegend überarbeitet werden. Microsoft übernimmt hinsichtlich der hier bereitgestellten Informationen keine Gewährleistungen, seien sie ausdrücklich oder konkludent.
Überlädt
RunConsoleAsync(IHostBuilder, CancellationToken) |
Aktiviert die Unterstützung der Konsole, erstellt und startet den Host und lauscht auf STRG+C oder SIGTERM, um das Herunterfahren auszulösen. |
RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken) |
Aktiviert die Unterstützung der Konsole, erstellt und startet den Host und lauscht auf STRG+C oder SIGTERM, um das Herunterfahren auszulösen. |
RunConsoleAsync(IHostBuilder, CancellationToken)
Aktiviert die Unterstützung der Konsole, erstellt und startet den Host und lauscht auf STRG+C oder SIGTERM, um das Herunterfahren auszulösen.
public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Threading.CancellationToken cancellationToken = default);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, System.Threading.CancellationToken cancellationToken = default);
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function RunConsoleAsync (hostBuilder As IHostBuilder, Optional cancellationToken As CancellationToken = Nothing) As Task
Parameter
- hostBuilder
- IHostBuilder
Die zu konfigurierende IHostBuilder-Schnittstelle.
- cancellationToken
- CancellationToken
Eine CancellationToken-Struktur kann zum Abbrechen der Konsole verwendet werden.
Gibt zurück
Ein Task, der nur abgeschlossen wird, wenn das Token signalisiert oder die Anwendung heruntergefahren wird.
- Attribute
Gilt für:
RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)
Aktiviert die Unterstützung der Konsole, erstellt und startet den Host und lauscht auf STRG+C oder SIGTERM, um das Herunterfahren auszulösen.
public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions, System.Threading.CancellationToken cancellationToken = default);
[System.Runtime.Versioning.UnsupportedOSPlatform("android")]
[System.Runtime.Versioning.UnsupportedOSPlatform("browser")]
[System.Runtime.Versioning.UnsupportedOSPlatform("ios")]
[System.Runtime.Versioning.UnsupportedOSPlatform("tvos")]
public static System.Threading.Tasks.Task RunConsoleAsync (this Microsoft.Extensions.Hosting.IHostBuilder hostBuilder, Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> configureOptions, System.Threading.CancellationToken cancellationToken = default);
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
[<System.Runtime.Versioning.UnsupportedOSPlatform("android")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("browser")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("ios")>]
[<System.Runtime.Versioning.UnsupportedOSPlatform("tvos")>]
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
<Extension()>
Public Function RunConsoleAsync (hostBuilder As IHostBuilder, configureOptions As Action(Of ConsoleLifetimeOptions), Optional cancellationToken As CancellationToken = Nothing) As Task
Parameter
- hostBuilder
- IHostBuilder
Die zu konfigurierende IHostBuilder-Schnittstelle.
- configureOptions
- Action<ConsoleLifetimeOptions>
Der Delegat zum Konfigurieren von ConsoleLifetime.
- cancellationToken
- CancellationToken
Eine CancellationToken-Struktur kann zum Abbrechen der Konsole verwendet werden.
Gibt zurück
Ein Task, der nur abgeschlossen wird, wenn das Token signalisiert oder die Anwendung heruntergefahren wird.
- Attribute