diff --git a/src/Kestrel/ServerFactory.cs b/src/Kestrel/ServerFactory.cs index 2c4b960306..65514e0fc8 100644 --- a/src/Kestrel/ServerFactory.cs +++ b/src/Kestrel/ServerFactory.cs @@ -48,7 +48,7 @@ namespace Kestrel async frame => { var request = new ServerRequest(frame); - await application.Invoke(request.Features); + await application.Invoke(request.Features).ConfigureAwait(false); })); } disposables.Add(engine); diff --git a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs index 4faca625a3..78d4c6f198 100644 --- a/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs +++ b/src/Microsoft.AspNet.Server.Kestrel/Http/Frame.cs @@ -234,7 +234,7 @@ namespace Microsoft.AspNet.Server.Kestrel.Http Exception error = null; try { - await Application.Invoke(this); + await Application.Invoke(this).ConfigureAwait(false); } catch (Exception ex) {