Asp.Net Core 2 Web API Timeout Issue

asp.net core 2 Web API timeout issue

adding requestTimeout to web.confg solved my timeout.

<aspNetCore requestTimeout="00:20:00" processPath="dotnet" arguments=".\project.dll" stdoutLogEnabled="false" stdoutLogFile=".\logs\stdout" />

Better approach is to Kick off request and then poll the result as suggested by @steve-land

Increase the timeout when logging with external provider

How to check of the real error is? I tried to increase the timeout
using:

You need change the time for BackchannelTimeout.

Reference:
https://docs.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.authentication.remoteauthenticationoptions.backchanneltimeout?view=aspnetcore-5.0

Timeouts with long running ASP.NET MVC Core Controller HTTPPost Method

But in .Net Core 2.0 there is no web.config file in project. It generate automatically.

I solved the problem by adding .UseKestrel(...) to the BuildWebHost function in Program.cs file as follows:

public static IWebHost BuildWebHost(string[] args) =>
WebHost.CreateDefaultBuilder(args)
.UseStartup<Startup>()
.UseKestrel(o => { o.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(10); })
.Build();
}

change DotNet 6 inbound request timeout

According to your description, I suggest you could try to modify it by changing the program.cs file codes:

More details, you could refer to below codes:

var builder = WebApplication.CreateBuilder(args);

builder.WebHost.UseKestrel(options =>
{
options.Limits.MaxConcurrentConnections = 100;
options.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(60);
});

how set the request timeout in asp .net core 3.1

issue is solved:

in web config :

<security>
<requestFiltering>
<!-- This will handle requests up to 300MB -->
<requestLimits maxAllowedContentLength="314572800" />
</requestFiltering>
</security>

and in asp core 3.1 ConfigureServices :
I did not understand the reason, but this piece of code solved the problem

services.Configure<FormOptions>(options =>
{
options.ValueLengthLimit = int.MaxValue;
options.MultipartBodyLengthLimit = long.MaxValue; // <-- ! long.MaxValue
options.MultipartBoundaryLengthLimit = int.MaxValue;
options.MultipartHeadersCountLimit = int.MaxValue;
options.MultipartHeadersLengthLimit = int.MaxValue;
});


Related Topics



Leave a reply



Submit