Afficher en anglais

Partage via


IHostedService.StopAsync(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éclenché quand l’hôte d’application effectue un arrêt normal.

C#
public System.Threading.Tasks.Task StopAsync(System.Threading.CancellationToken cancellationToken);

Paramètres

cancellationToken
CancellationToken

Indique que le processus d’arrêt ne doit plus être normal.

Retours

Task qui représente l’opération Stop asynchrone.

Exceptions

Le jeton d’annulation a été annulé. Cette exception est stockée dans la tâche retournée.

S’applique à

Produit Versions
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)
.NET Standard 2.0 (package-provided), 2.1 (package-provided)