Monitor IIS AppPool from ASP.NET web service

Discussion in 'ASP .Net Web Services' started by Navin Mishra, Jul 28, 2005.

  1. Navin Mishra

    Navin Mishra Guest

    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
     
    Navin Mishra, Jul 28, 2005
    #1
    1. Advertising

  2. 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


    "Navin Mishra" <> wrote in message
    news:...
    > 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
    >
    >
     
    Clemens Reijnen, Jul 30, 2005
    #2
    1. Advertising

  3. Navin Mishra

    Navin Mishra Guest

    Thanks. A concrete example is appreciated for the newbie like me!

    "Clemens Reijnen" <> wrote in message
    news:...
    > 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
    >
    >
    > "Navin Mishra" <> wrote in message
    > news:...
    > > 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
    > >
    > >

    >
    >
     
    Navin Mishra, Aug 2, 2005
    #3
  4. Navin Mishra

    Navin Mishra Guest

    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

    "Navin Mishra" <> wrote in message
    news:eUl%...
    > Thanks. A concrete example is appreciated for the newbie like me!
    >
    > "Clemens Reijnen" <> wrote in message
    > news:...
    > > 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
    > >
    > >
    > > "Navin Mishra" <> wrote in message
    > > news:...
    > > > 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
    > > >
    > > >

    > >
    > >

    >
    >
     
    Navin Mishra, Aug 6, 2005
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. =?Utf-8?B?UGlnZ2xldDE4Nw==?=

    AppPool Recycle Failure

    =?Utf-8?B?UGlnZ2xldDE4Nw==?=, Jun 8, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    1,337
    Natty Gur
    Jun 9, 2004
  2. ScottZ
    Replies:
    2
    Views:
    409
    Jorgen Grahn
    Nov 2, 2008
  3. Kevin C
    Replies:
    2
    Views:
    228
    Hernan de Lahitte
    Nov 19, 2004
  4. 401 if AppPool is not Network Service

    , Mar 23, 2006, in forum: ASP .Net Security
    Replies:
    2
    Views:
    172
    AlanM
    Mar 23, 2006
  5. Navin Mishra

    How to detect if hosting IIS AppPool is recycled or stopped ?

    Navin Mishra, May 2, 2005, in forum: ASP .Net Web Services
    Replies:
    0
    Views:
    172
    Navin Mishra
    May 2, 2005
Loading...

Share This Page