Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>As far as I'm aware by default IIS will shut down (recycle) the worker pool that the site is attached to if it isn't accessed for more than 20 minutes. This setting can be changed and there are tools that will help keep the site 'alive'.</p> <p>The code in Application_Start in the global.asax file will only fire once when the application is started and loaded into the pool. Accessing any page on the site will not fire it again. When the pool is recycled and a page is requested, the application will start again and Application_start will be fired.</p> <p>What I'm not sure of is if the timer you have set will keep the application alive. My guess is it won't.</p> <p><strong>Edit:</strong></p> <p>The timer won't keep the site alive, this might be of help (from <a href="http://www.west-wind.com/weblog/posts/2007/May/10/Forcing-an-ASPNET-Application-to-stay-alive" rel="nofollow">http://www.west-wind.com/weblog/posts/2007/May/10/Forcing-an-ASPNET-Application-to-stay-alive</a>)</p> <pre><code> public void PingServer() { try { WebClient http = new WebClient(); string Result = http.DownloadString(App.Configuration.PingUrl); } catch (Exception ex) { string Message = ex.Message; } } </code></pre> <p>And on Application Exit call</p> <pre><code>void Application_End(object sender, EventArgs e) { // Force the App to be restarted immediately new YourClassName().PingServer(); } </code></pre> <p>Problem with this approach is the timer wont be accurate as it will be disposed of when the pool tries to recycle and then started again.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload