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
Difference Between Lookup() and Dictionary(Of List())
Creating PDF Files at Runtime in C#
Mock Httpcontext for Unit Testing a .Net Core MVC Controller
How to Compare Unicode Characters That "Look Alike"
String.Isnullorempty(String) VS. String.Isnullorwhitespace(String)
How to Add a Line Break in C# .Net Documentation
String.Replace() VS. Stringbuilder.Replace()
What Do Programmers Mean When They Say, "Code Against an Interface, Not an Object."
Open File Dialog and Select a File Using Wpf Controls and C#
Post Build Event Execute Powershell
How to Add a String to a String[] Array? There's No .Add Function
Converting Xml to a Dynamic C# Object
Should You Obfuscate a Commercial .Net Application
How to Get User Type C# Syntax Highlighting Working Again in VS 2012 Rc
What's a Good Threadsafe Singleton Generic Template Pattern in C#