diff --git a/src/Microsoft.AspNetCore.NodeServices/HostingModels/PhysicalConnections/NamedPipeConnection.cs b/src/Microsoft.AspNetCore.NodeServices/HostingModels/PhysicalConnections/NamedPipeConnection.cs index 0d0d79b..7a980cf 100644 --- a/src/Microsoft.AspNetCore.NodeServices/HostingModels/PhysicalConnections/NamedPipeConnection.cs +++ b/src/Microsoft.AspNetCore.NodeServices/HostingModels/PhysicalConnections/NamedPipeConnection.cs @@ -12,12 +12,18 @@ namespace Microsoft.AspNetCore.NodeServices.HostingModels.PhysicalConnections #pragma warning disable 1998 // Because in the NET451 code path, there's nothing to await public override async Task Open(string address) { - _namedPipeClientStream = new NamedPipeClientStream(".", address, PipeDirection.InOut); + _namedPipeClientStream = new NamedPipeClientStream( + ".", + address, + PipeDirection.InOut, + PipeOptions.Asynchronous); + #if NET451 _namedPipeClientStream.Connect(); #else await _namedPipeClientStream.ConnectAsync().ConfigureAwait(false); #endif + return _namedPipeClientStream; } #pragma warning restore 1998