Vasudha Gupta
Vasudha Gupta

Reputation: 171

ASP.NET Performance Counter value

I am building a library project that will record the values of ASP.NET Performance Counters when used with a ASP.NET Project. But when I try to run the following code -

var  _RequestsPerSecond = new PerformanceCounter("ASP.NET Applications",  "Requests/sec", Process.GetCurrentProcess().ProcessName);
_RequestsInApplicationQueueValue = _RequestsInApplicationQueue.NextValue();

It gives me the error iis express does not exist in this category. Any suggestions.?

Upvotes: 0

Views: 712

Answers (1)

jay liu
jay liu

Reputation: 129

replace Process.GetCurrentProcess().ProcessName as System.Web.Hosting.HostingEnvironment.ApplicationID.Replace('/', '_')

Upvotes: 1

Related Questions