http://blog.csdn.net/rryqsh/article/details/8156558
If you're doing ASP, you'll definitely use IIS
If you want to add a timed task to the ASP. NET application, it must be a thread that keeps doing the timed calculation.
That assumes that we have added the Quartz.net framework to our ASP. NET application, and the configuration and so on are OK.
This site access is very small, now only a few people to work, the results of the next day to see, the background of the scheduled threads and computing tasks are stopped, if you crawl the Application_End event, you will find that the event was actually called.
That must be the mechanism of application pool recycling for IIS in mischief. Because of IIS's default settings, if a site is in an application pool that has not been accessed or requested for more than a period of time, IIS automatically reclaims the program pool and kills the process. The threads within that process must not survive.
However, we can set the application pool parameters so that they are not automatically recycled (some cases cannot be avoided, such as a hot-deployed site, the number of errors overrun, etc.)
In IIS, locate the program pool used by this site, and click "Advanced Settings ..."
In the list that opens, change the following settings:
Recycle--Fixed time interval (minutes) changed to 0
--Virtual/private memory limit (KB) changed to 0
Process Model-idle timeout (minutes) changed to 0
This way, in general, the program pool will not be automatically recycled, some simple computing threads in the background will work properly
IIS 7 Application Pool Auto-Recycle closed solution