HostingHostBuilderExtensions.RunConsoleAsync Méthode
Définition
Important
Certaines informations portent sur la préversion du produit qui est susceptible d’être en grande partie modifiée avant sa publication. Microsoft exclut toute garantie, expresse ou implicite, concernant les informations fournies ici.
Surcharges
| Nom | Description |
|---|---|
| RunConsoleAsync(IHostBuilder, CancellationToken) |
Active la prise en charge de la console, génère et démarre l’hôte, et attend que Ctrl+C ou SIGTERM s’arrête. |
| RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken) |
Active la prise en charge de la console, génère et démarre l’hôte, et attend que Ctrl+C ou SIGTERM s’arrête. |
RunConsoleAsync(IHostBuilder, CancellationToken)
Active la prise en charge de la console, génère et démarre l’hôte, et attend que Ctrl+C ou SIGTERM s’arrête.
[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
Paramètres
- hostBuilder
- IHostBuilder
À IHostBuilder configurer.
- cancellationToken
- CancellationToken
Qui CancellationToken peut être utilisé pour annuler la console.
Retours
Une Task opération qui se termine uniquement lorsque le jeton est déclenché ou qu’il est arrêté.
- Attributs
Exceptions
Le jeton d’annulation a été annulé. Cette exception est stockée dans la tâche retournée.
S’applique à
RunConsoleAsync(IHostBuilder, Action<ConsoleLifetimeOptions>, CancellationToken)
Active la prise en charge de la console, génère et démarre l’hôte, et attend que Ctrl+C ou SIGTERM s’arrête.
[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
Paramètres
- hostBuilder
- IHostBuilder
À IHostBuilder configurer.
- configureOptions
- Action<ConsoleLifetimeOptions>
Délégué pour la configuration du ConsoleLifetime.
- cancellationToken
- CancellationToken
Qui CancellationToken peut être utilisé pour annuler la console.
Retours
Une Task opération qui se termine uniquement lorsque le jeton est déclenché ou qu’il est arrêté.
- Attributs
Exceptions
Le jeton d’annulation a été annulé. Cette exception est stockée dans la tâche retournée.