dotnet / aspnetcore

ASP.NET Core is a cross-platform .NET framework for building modern cloud-based web applications on Windows, Mac, or Linux.
https://asp.net
MIT License
35.35k stars 9.99k forks source link

RequestTimeout in ASP.NET Core 3.1 is not availablewhen using InProcess Hosting #23160

Closed chrismcmorran closed 4 years ago

chrismcmorran commented 4 years ago

Describe the bug

When hosting in process on IIS the httpRuntime requestTimeout attribute is ignored. The documentation states that the module will wait for the app to finish processing the request. I am currently migrating a project from .NET Framework to ASP.NET Core 3.1; I don't believe that there is any way to limit the amount of time that a request will be processed before being stopped by the runtime. Is this functionality available via middleware? Hosting out of process is not an option and I would like to avoid using a thread to track execution time.

BrennanConroy commented 4 years ago

httpRuntime has the executionTimeout setting, and ANCM has the requestTimeout option.

requestTimeout is not supported with in-process https://docs.microsoft.com/aspnet/core/host-and-deploy/aspnet-core-module?view=aspnetcore-3.1#in-process-hosting-model.

We would suggest writing custom middleware for request timeouts.