title: Check if IIS Application is running without causing it to run
body: <p>I am writing a web monitor app that gives information about all app pools / apps on my IIS server.  I am looking for a way in C# to programmatically check if an IIS application is running without causing it to run if it is not.</p>
  
  <p>Here is what I have found...</p>
  
  <ol>
  <li>application is running, there are one or more sessions active.</li>
  <li>all sessions dropped off...application still "running", app pool worker process is running.</li>
  <li>At some point determined by IIS, the Application_End is finally executed...however, the app pool worker process is still running.</li>
  <li>After 20 minutes, the app pool worker process finally shuts down due to inactivity.</li>
  </ol>
  
  <p>It is between #3 and #4 that I am having trouble.  The application has ended, but if I try to send an Http Request to the app, it will automatically start up.  I am looking for a way to programmatically determine if the application has ended (while the worker process is still active awaiting shutdown) without restarting the Application.</p>
  
  <p>I can try to provide more details if you are unsure what I am talking about.</p>
  
  <p>Regards,
  Jeremy</p>