Why isn't this working? IIS kills my app anyway after 20 mins
protected void Application_Start()
{
Task.Factory.StartNew(() => DaemonStuff());
}
private void DaemonStuff()
{
// Ping to self
MyWebRequest selfRequest = new MyWebRequest(MyURL, "GET");
selfRequest.GetResponse();
// Sleep
Thread.Sleep(1000 * 60 * 5);
}
What I'm doing here is visiting my own site (with a webrequest) every 5 minutes.
This way, IIS shouldnt think my site is idle, because its getting visits, but it kills the app anyway.
So: is it possible to fake visits to my own site every 5 minutes so that it doesn't get killed?