- From the Visual Studio select Create a new project. Select ASP.NET Core 3.1
- Publish and Host in IIS
- Increase upload file size this code :
public void ConfigureServices(IServiceCollection services)
{
services.Configure<IISServerOptions>(options =>
{
options.MaxRequestBodySize = 314572800;
});
services.AddControllersWithViews();
}
and web config:
<security>
<requestFiltering>
<!-- This will handle requests up to 300MB -->
<requestLimits maxAllowedContentLength="314572800" />
</requestFiltering>
</security>
The above applies correctly but the default timeout is 2 min
How can I increase the timeout in ASP.NET Core 3.1 app hosted in IIS?
Note: my web.config
<aspNetCore processPath="dotnet" arguments=".\AspCoreTestFileUpload.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" hostingModel="inprocess" />
for requestTimeout : Doesn't apply to in-process hosting. For in-process hosting, the module waits for the app to process the request.
I have to use inprocess hostingModel