The solution to the problem that the IIS application pool recycle causes the timed execution program to stop in Application_Start _ Practical Tips

Source: Internet
Author: User
And this time no one again visit the site, the results in the application_start of the timing of the execution of the program code will not be carried out, search on the Internet, found a solution, now and everyone to share the communication, the principle is to send a Web request at the end of the application site to visit, Start Application_Start.
Copy Code code as follows:

void Application_End (object sender, EventArgs e)
{
Code that runs when the application shuts down
Resolving Application Pool Recycling issues
System.Threading.Thread.Sleep (5000);
String strURL = "web address";
System.Net.HttpWebRequest _httpwebrequest = (System.Net.HttpWebRequest) System.Net.WebRequest.Create (strURL);
System.Net.HttpWebResponse _httpwebresponse = (System.Net.HttpWebResponse) _httpwebrequest.getresponse ();
System.IO.Stream _stream = _httpwebresponse.getresponsestream ();//get writeback byte stream
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.