Process.WaitForExitAsync(CancellationToken) Method

Definition

Instructs the process component to wait for the associated process to exit, or for the cancellationToken to be cancelled.

public System.Threading.Tasks.Task WaitForExitAsync (System.Threading.CancellationToken cancellationToken = default);
member this.WaitForExitAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task
Public Function WaitForExitAsync (Optional cancellationToken As CancellationToken = Nothing) As Task

Parameters

cancellationToken
CancellationToken

An optional token to cancel the asynchronous operation.

Returns

Task

A task that will complete when the process has exited, cancellation has been requested, or an error occurs.

Remarks

Calling this method will set EnableRaisingEvents to true.

Applies to