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.
Here is what I have found...
- application is running, there are one or more sessions active.
- all sessions dropped off...application still "running", app pool worker process is running.
- At some point determined by IIS, the Application_End is finally executed...however, the app pool worker process is still running.
- After 20 minutes, the app pool worker process finally shuts down due to inactivity.
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.
I can try to provide more details if you are unsure what I am talking about.
Regards, Jeremy