HostingHostBuilderExtensions.RunConsoleAsync Methode

Definitie

Overloads

Name Description
RunConsoleAsync(IHostBuilder, CancellationToken)

Hiermee schakelt u consoleondersteuning, bouwt en start u de host en wacht u tot Ctrl+C of SIGTERM wordt afgesloten.

RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)

Hiermee schakelt u consoleondersteuning, bouwt en start u de host en wacht u tot Ctrl+C of SIGTERM wordt afgesloten.

RunConsoleAsync(IHostBuilder, CancellationToken)

Bron:
HostingHostBuilderExtensions.cs
Bron:
HostingHostBuilderExtensions.cs
Bron:
HostingHostBuilderExtensions.cs
Bron:
HostingHostBuilderExtensions.cs

Hiermee schakelt u consoleondersteuning, bouwt en start u de host en wacht u tot Ctrl+C of SIGTERM wordt afgesloten.

[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);
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")>]
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * System.Threading.CancellationToken -> System.Threading.Tasks.Task
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

Parameters

hostBuilder
IHostBuilder

De IHostBuilder te configureren.

cancellationToken
CancellationToken

Een CancellationToken die kan worden gebruikt om de console te annuleren.

Retouren

Een Task die alleen wordt voltooid wanneer het token wordt geactiveerd of afgesloten, wordt geactiveerd.

Kenmerken

Uitzonderingen

Het annuleringstoken is geannuleerd. Deze uitzondering wordt opgeslagen in de geretourneerde taak.

Van toepassing op

RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)

Bron:
HostingHostBuilderExtensions.cs
Bron:
HostingHostBuilderExtensions.cs
Bron:
HostingHostBuilderExtensions.cs
Bron:
HostingHostBuilderExtensions.cs

Hiermee schakelt u consoleondersteuning, bouwt en start u de host en wacht u tot Ctrl+C of SIGTERM wordt afgesloten.

[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);
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")>]
static member RunConsoleAsync : Microsoft.Extensions.Hosting.IHostBuilder * Action<Microsoft.Extensions.Hosting.ConsoleLifetimeOptions> * System.Threading.CancellationToken -> System.Threading.Tasks.Task
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

Parameters

hostBuilder
IHostBuilder

De IHostBuilder te configureren.

configureOptions
Action<ConsoleLifetimeOptions>

De gemachtigde voor het configureren van de ConsoleLifetime.

cancellationToken
CancellationToken

Een CancellationToken die kan worden gebruikt om de console te annuleren.

Retouren

Een Task die alleen wordt voltooid wanneer het token wordt geactiveerd of afgesloten, wordt geactiveerd.

Kenmerken

Uitzonderingen

Het annuleringstoken is geannuleerd. Deze uitzondering wordt opgeslagen in de geretourneerde taak.

Van toepassing op