How to Increase Executiontimeout for a Long-Running Query

How to Set executionTimeout to infinite

you can give it as below in web.config file :-

<httpRuntime executionTimeout = "10000000000000"/> ////Value is in Second

As documented in official site under executionTimeout section:-

This time-out applies only if the debug attribute in the compilation
element is False. Therefore, if the debug attribute is True, you do
not have to set this attribute to a large value in order to avoid
application shutdown while you are debugging. The default is 110
seconds

Long running query timing out

Did you check if your connection from sql server is configured any different from the connection string you are using. I would suspect that is the reason for it working from the sql server but not the code.
Some options are checked by default in sql server. It should be under tools.
You may add SET statements to your code to match that.

Also see if this would help - http://www.serverintellect.com/support/programming/sql-qtimeout/

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();
}

... Update for .net Core 6 ...

in Program.cs file after

var builder = WebApplication.CreateBuilder(args);

add ConfigureKestrel for WebHost like this

builder.WebHost.ConfigureKestrel(c =>
{
c.Limits.KeepAliveTimeout = TimeSpan.FromMinutes(15);
});

Increase ASP.NET page timeout

This should solve your problem.
In the web.config put

<location path="somefile.aspx">
<system.web>
<httpRuntime executionTimeout="180"/>
</system.web>
</location>

Here is the source



Related Topics



Leave a reply



Submit