diff --git a/dotnet/src/Microsoft.AutoGen/Microsoft.AutoGen.Runtime.Grpc/GrpcWorkerConnection.cs b/dotnet/src/Microsoft.AutoGen/Microsoft.AutoGen.Runtime.Grpc/GrpcWorkerConnection.cs index c3bdce73d60f..e9c77d1ede92 100644 --- a/dotnet/src/Microsoft.AutoGen/Microsoft.AutoGen.Runtime.Grpc/GrpcWorkerConnection.cs +++ b/dotnet/src/Microsoft.AutoGen/Microsoft.AutoGen.Runtime.Grpc/GrpcWorkerConnection.cs @@ -95,7 +95,7 @@ public async Task RunReadPump() } finally { - _shutdownCancellationToken.Cancel(); + await _shutdownCancellationToken.CancelAsync(); _gateway.OnRemoveWorkerProcess(this); } }