0

I've implemented this solution to running a long running task in asp.net http://haacked.com/archive/2011/10/16/the-dangers-of-implementing-recurring-background-tasks-in-asp-net.aspx

But I've been getting this error: "A process serving application pool 'DefaultAppPool' exceeded time limits during shut down. The process id was '1111'. " Has anyone run into this issue before and know what, if anything, I've done wrong.

Is there a limit to how long asp.net will wait because my task may take at least a couple hours to run.

Please don't answer by saying I shouldn't be using asp.net. I have to at this point.

thanks.

user204588
  • 1,613
  • 4
  • 31
  • 50
  • If the process is taking that long, could it not be split into smaller chunks and ran in that manner. A couple of hours is a long time to have a http process running. – ChrisBint Aug 17 '12 at 02:28
  • Yes, I would split this up into page1.aspx, page2.aspx... and then call each, sequentially (if possible). – ChrisBint Aug 17 '12 at 02:44

1 Answers1

0

Asp.net is not suited for long running tasks. (As also noted if the blog you mentioned.)

The best solution for long running tasks would be to some framework that is meant for long running jobs.

You should consider using a windows service. You could have a table to keep track of the status of such long running jobs, and your pages could show user the job status from these tables.

nunespascal
  • 17,584
  • 2
  • 43
  • 46