diff --git a/samples/NativeIISSample/applicationhost.config b/samples/NativeIISSample/applicationhost.config index 7413742ed4..2f094eb5c4 100644 --- a/samples/NativeIISSample/applicationhost.config +++ b/samples/NativeIISSample/applicationhost.config @@ -299,12 +299,12 @@ - + - + diff --git a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpServer.cs b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpServer.cs index a6c43f4b6f..252eff1bd9 100644 --- a/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpServer.cs +++ b/src/Microsoft.AspNetCore.Server.IISIntegration/Server/IISHttpServer.cs @@ -80,14 +80,7 @@ namespace Microsoft.AspNetCore.Server.IISIntegration var context = server._iisContextFactory.CreateHttpContext(pInProcessHandler); - var task = context.ProcessRequestAsync(); - - // This should never fail - if (task.IsCompleted) - { - context.Dispose(); - return ConvertRequestCompletionResults(task.Result); - } + var task = Task.Run(() => context.ProcessRequestAsync()); task.ContinueWith((t, state) => CompleteRequest((IISHttpContext)state, t), context);