tags:

views:

152

answers:

2

I want to use the information obtained by calling System.Web.ProcessModelInfo.GetCurrentProcessInfo(). But MSDN says this method can only be used with IIS 5 or IIS 6 with IIS 5.0 isolation mode. I do not want to use IIS 5 isolation mode. Is reading from Performance Counters the only way around?

+1  A: 

The IIS architecture has been changed quite radically over the different versions. Personally I would not rely on anything that isn't part of the basic ISAPI filter and extensions APIs. Using the performance counters is likely to be more future proof.

For a definitive answer you should try to track down David Wang's current blog -- I don't have the rep to post links :/ It's been a while since I last read his blog, but if he's still active then you're going to get a much better answer from him (he's one of the main IIS developers at MS).

Good luck.

KayEss
Thank you KayEss.I did checkout David Wang's blog and sure enough very insightful. But I couldn't find the answer to my problem though.
HashName
+1  A: 

You could use Process.GetProcessByName to get the information on the IIS worker process that you're interested in.

JP Alioto
Thank you JP.This definitely looks like a workable solution. I'll try it out and let u know.Btw, do u think that calling this from a low privilege process like w3wp.exe will cause a problem , a security exception if you will..
HashName
If you're running with FullTrust, you should be fine. But if not, here's a work around http://blogs.msdn.com/shawnfa/archive/2005/12/14/502826.aspx
JP Alioto
How do I can verify that it's running on FullTrust? I'm sorry I've a poor understanding of .Net Security model.
HashName
You should be running in FullTrust by default, but check out this article http://msdn.microsoft.com/en-us/library/wyts434y(vs.80).aspx
JP Alioto