diff --git a/src/csharp/Grpc.Core/GrpcEnvironment.cs b/src/csharp/Grpc.Core/GrpcEnvironment.cs index 9fad5c6a54e..cf5e47e3d56 100644 --- a/src/csharp/Grpc.Core/GrpcEnvironment.cs +++ b/src/csharp/Grpc.Core/GrpcEnvironment.cs @@ -321,7 +321,7 @@ namespace Grpc.Core throw new InvalidOperationException("ShutdownAsync has already been called"); } - await Task.Run(() => ShuttingDown?.Invoke(this, null)); + await Task.Run(() => ShuttingDown?.Invoke(this, null)).ConfigureAwait(false); await threadPool.StopAsync().ConfigureAwait(false); GrpcNativeShutdown();