Long running task in ASP.Net

Discussion in 'ASP.NET / ASP.NET Core' started by hutton, Jun 3, 2009.

Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.
  1. I have a need for my web site to perform a long running task in the background. I tried using a scheduled task but my task needs to run for a long time and this times out.

    I'm now creating a new thread in Global.asmx > Application_Start as described in Rick Strahl's article below.

    http://www.west-wind.com/WebLog/posts/67557.aspx

    Is this the best approach for hosting a long running thread, particularly in the context of being hosted on Discount ASP.Net?

    Thanks
     
  2. Bruce

    Bruce DiscountASP.NET Staff

    the scheduled task tool simply makes a http call to the page you specified. It doesn't matter whether it times out of not because even the scheduled task stop waiting for the page execution to finish, the page is still running on the server.
     
  3. A while back I had a similar problem with the DASP scheduler calling a web page that in turn was calling a web service that would take a while to process.

    The outcome was that the scheduler would report a timeout in the control panel but the process did successfully complete. It did bug me for a while so in the end I added this to my web.config and it solved the problem:

    <system.web>
    <httpRuntime executionTimeout="3600"/>...
    </system.web>

    Note this only works when <compilation debug="false">

    More info here: http://msdn.microsoft.com/en-us/library/e1f13641.aspx
     
Thread Status:
Threads that have been inactive for 5 years or longer are closed to further replies. Please start a new thread.

Share This Page