IHost.StartAsync(CancellationToken) 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.
Démarre les IHostedService objets configurés pour le programme. L’application s’exécute jusqu’à ce qu’elle soit interrompue ou jusqu’à ce qu’elle StopApplication() soit appelée.
public System.Threading.Tasks.Task StartAsync(System.Threading.CancellationToken cancellationToken = default);
abstract member StartAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function StartAsync (Optional cancellationToken As CancellationToken = Nothing) As Task
Paramètres
- cancellationToken
- CancellationToken
Utilisé pour abandonner le démarrage du programme.
Retours
Une Task opération qui sera terminée au IHost démarrage.
Exceptions
Le jeton d’annulation a été annulé. Cette exception est stockée dans la tâche retournée.