How to get event notification that a web site is started/stopped

How is it possible to get event notification in IIS that a web site started or stopped ?

Who is Participating?
I guess web site is monitored by separate thread. You can do some investigation in this direction, may install an ISAPI filter, handle THREAD_ATTACH/THREAD_DETACH event in DllMain.
When the Web service is stopped or unloaded, IIS calls TerminateFilter in all ISAPI filters as part of its shutdown sequence, for any filters that implemented and exported the function. TerminateFilter is typically used to perform cleanup and de-allocation of allocated resources.

GetFilterVersion is called exactly once, when the ISAPI filter is initially loaded. Any per-connection initializations the developer wants to perform must be managed internally within the context of the HttpFilterProc function call.

Find more details at
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.