This way my admin/processing page got enough time, while pages for end users and such kept their old time out behaviour.īelow I gave the config for you Googlers needing the same quick fix. ![]() But to allow a temporary quick fix on production I used the config version in a tag in web.config. Great and exhaustive answerby I did long processing only in one admin page in a WebForms application I used the code option. The other alternative, if you have administrator access to the server, is to consider this long running operation as a candidate for implementing as a scheduled task or a windows service. This will increase the scalability of your application. If your script is taking several minutes to execute and there are many concurrent users then consider changing the page to an Asynchronous Page. This value can also be configured in your web.config file in the sessionState configuration element: If you've already done this but are finding that your session is expiring then increase theįor example: // Increase session timeout to thirty minutes Not have to set this attribute to a large value in order to avoidĪpplication shutdown while you are debugging." Therefore, if the debug attribute is True, you do "This time-out applies only if the debug attribute in the compilationĮlement is False. Please note according to the MSDN documentation: This value can also be configured in your web.config file in the httpRuntime configuration element: ![]() NET 2.0 and later.įor example: // Increase script timeout for current page to five minutes The following experiment shows this behavior.įirst, CancellationToken will have a 1 second timeout, and HttpClient.Timeout will be 5 seconds.If you want to extend the amount of time permitted for an ASP.NET script to execute then increase the Server.ScriptTimeout value. Note: HttpClient.Timeout defaults to 100 seconds. ![]() So if you’re using CancellationTokens to control the timeout per request, make sure to initialize HttpClient.Timeout to a value greater than the max timeout you want to use. Since you can’t change HttpClient.Timeout after the instance has been used, this means you can’t change the timeout to a value greater than HttpClient.Timeout. Keep this in mind when you’re trying to control the timeout.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |