Monitor IIS AppPool from ASP.NET web service

N

Navin Mishra

Hi,

How could I monitor IIS AppPool from the ASP.NET web service which is
hosted in that same AppPool ? I guess I could use WMI but I've not played
around with it. Is there an example code in ASP.NET for this need ? My
problem is Application_End is not being fired and so I want to trap when the
hosting AppPool recycles so that I could do properly cleamup.

Thanks in advance and regards

Navin
 
C

Clemens Reijnen

to use wmi in your c# files you have to use the System.Management namespace
and query voor the iis wmi-classes:

ManagementObjectSearcher Searcher = new ManagementObjectSearcher();
ManagementScope Scope = new ManagementScope("root\\iis name have to look
for it");

Searcher.Scope = Scope;
SelectQuery Query = new SelectQuery();

StringBuilder queryString = new StringBuilder();
queryString.Append("SELECT * FROM bla bla");
etc
etc
etc

to find all the parameters and methods you can use cim-studio

greets clemens
 
N

Navin Mishra

Could it be happening because of multiple asmx files in my web service ? In
a test web service in which there is a single ASMX file, Application_End is
being fired all right. But not when there are multiple asmx files ?

Thanks in advance and regards
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,996
Messages
2,570,238
Members
46,826
Latest member
robinsontor

Latest Threads

Top