title: How manually create first request for asp.net mvc on iis7.5 when every time restart or release the website?
body: <p>You guys all know: on <strong>IIS7.5</strong> the first request very <strong>slow</strong>. So I think maybe I can <strong>manually create a request</strong> when every time the website start, restart, after cycle time finish.....so on.</p>
  
  <p>I'm search a lot , then I found Auto starting feature:<a href="http://www.schwammysays.net/auto-starting-websites-on-iis-7-5/" rel="nofollow">http://www.schwammysays.net/auto-starting-websites-on-iis-7-5/</a></p>
  
  <p>after I add this, I manually create a request in <strong>Application_Start()</strong> on <strong>Global.asax</strong> </p>
  
  <pre><code>protected void Application_Start()
  {
       ''    original logic here     ''
  
   System.Threading.Tasks.Task.Factory.StartNew(new Action(() =&gt;
              {
                  try
                  {
                      // send request after 100 second
                      System.Threading.Thread.Sleep(1000 * 100 * 1);
                      WebClient webClient = new WebClient();
                      using (Stream stream = webClient.OpenRead(ConfigurationManager.AppSettings["InitialPath"]))
                      {
                          if (stream.CanRead)
                          {
                              log.Debug("warm success");
                          }
                          else
                          {
                              log.Debug("can't read");
                          }
                      }
  
                  }
                  catch (Exception ex)
                  {
                      log.Error(ex);
                  }
              }));
  }
  </code></pre>
  
  <p>but problem is :
  1. that only fired when the IIS7.5 cycle time finish. not fired when restart website, start, or release it(even change web.config).
  2. Some website still not fired, I don't understand.</p>
  
  <p>So I'm searching Is there any other way can fired <strong>Application_Start()</strong> or create a request when website start, change, restart, IIS cycle time finish?
  My server is : windows server 2008 r2</p>