ASP.NET Performance counters missing

We get this problem from time to time so I thought I would talk about what to do when the performance counters are missing for ASP.NET.

Method 1

The first piece of advice is to upgrade to the latest version of the framework, so the latest Service Pack.  This will make sure you have any fixes that may have already been done to help the issue.  You can get the latest Service Pack here.

Method 2

The next step, if that doesn’t help is to try running the ASP.NET IIS Registration Tool yourself and see if that works correctly.  You can run this by going into your .NET folder (%WINDIR%\Microsoft.NET\<framework version>) and running:

aspnet_regiis.exe -i

If aspnet_regiis gives an error, you can look at the error log that it references for clues of what is wrong, like permissions:

D:\WINNT\Microsoft.NET\Framework\v2.0.50727>aspnet_regiis.exe -i
Start installing ASP.NET (2.0.50727).
.............
Finished installing ASP.NET (2.0.50727).
Setup has detected some errors during the operation.
For details, please read the setup log file
D:\DOCUME~1\FWTLABB\LOCALS~1\Temp\ASPNETSetup_00006.log

Method 3

If neither of those help matters, then we can try doing something a little more drastic.  The following steps are another way to try to get them added:

  1. Check the following Registry key and make sure that it points to the correct
    aspnet_perf.dll:
    HKLM\SYSTEM\CurrentControlSet\Services\
    ASP.NET_2.0.50727\Performance\Library
  2. Perform the following steps:
    a. Shut down IIS.
    net stop iisadmin /y
    b. Shut down the "Remote Registry" service.
    net stop "remote registry"
    c. Shut down anything else that might be monitoring performance (i.e. Perfmon).
    d. Run the following commands to unload/reload the per counter texts:
    unlodctr ASP.NET_2.0.50727
    unlodctr ASP.NET_64_2.0.50727
    unlodctr ASP.NET
  3. Then from the v2.0.50727 folder, do this from the Framework64 and Framework folders:
    lodctr aspnet_perf.ini
    lodctr aspnet_perf2.ini
  4. Restart IIS.
    net start iisadmin

Now check the following key and see if there is a new entry:

HKLM\SYSTEM\CurrentControlSet\Services\
ASP.NET_2.0.50727\Names
HKLM\SYSTEM\CurrentControlSet\Services\
ASP.NET_64_2.0.50727\Names

The name is a long random thing, but the data should be the PID of the worker process that is running. If this works, then the ACL for the key is correct. If there is no entry (even though ASP.NET pages are executing) then there is an ACL issue with the key. Make sure that the worker process identity can write to that key.

If the .NET counters are also missing, you can add the following to the steps above:

in step 2. c:

unlodctr ".NETFramework" 
unlodctr ".NET CLR Data" 
unlodctr ".NET CLR Networking" 
regsvr32 /u C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_perf.dll 
regsvr32 /u C:\WINNT\system32\mscoree.dll 
regsvr32 C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_perf.dll 
regsvr32 C:\WINNT\system32\mscoree.dll 

in step 3:

lodctr CORPerfMonSymbols.ini 
lodctr _dataperfcounters.ini 
lodctr _NetworkingPerfCounters.ini 

Note: For 1.1, replace aspnet_perf.dll with aspnet_isapi.dll in the above steps.

Method 4

One more issue, if you have installed the security fix for MS07-040 and try to open perfmon and add a counter and after not seeing ASP.NET in the list, if you look in your Event Log and see an error:

Event Type: Error
Event Source: Perflib
Event Category: None
Event ID: 1008
Date:  7/11/2007
Time:  1:03:15 PM
User:  N/A
Computer: BAD02
Description:
The Open Procedure for service "ASP.NET" in DLL "
C:\WINNT\Microsoft.NET\Framework\v2.0.50727\aspnet_perf.dll" 
failed.  Performance data for this service will not be 
available. Status code returned is data DWORD 0. 
Data:
0000: 05 40 00 80

Try getting the fix from KB 944746

I’ll update this post if any additional methods are discovered to fix this issue.

kick it on DotNetKicks.com

Published 11 April 08 11:45 by Tom
Filed under: ,

Comment Notification

If you would like to receive an email when updates are made to this post, please register here

Subscribe to this post's comments using RSS

Comments

# DotNetKicks.com said on April 11, 2008 11:46 AM:

You've been kicked (a good thing) - Trackback from DotNetKicks.com

# Jonathan Wanagel said on April 16, 2008 4:03 AM:

One time I had a problem with the performance counters showing up but always with the value of 0, and it was because I was on a 64 bit operating system with ASP.NET running in 32 bit mode.  So when I open performance monitor, it was monitoring the 64 bit counters.  I opened the performance monitor from the 32 bit directory and then the ASP.NET counters showed the correct values.

# Tom said on April 16, 2008 9:32 AM:

Very good point Jonathan.  If you are running on a 64-bit OS, you have to be very careful which performance monitor you start as it will affect which counters you can see.

# alikl said on April 22, 2008 3:37 AM:

Thanks a lot!

This post helped me to solve the problem at customer's

alikl

# bill mitchell said on April 25, 2008 2:45 PM:

perfect solution to one of my issues, thanks alot

# Tom Brodner said on May 5, 2008 3:11 PM:

You are the bomb!  Permissions issue detected in the log file, corrected and all is well.

Tom

# Jonathan Bergeron said on August 15, 2008 4:06 PM:

Jonathan's comment above greatly helped me in figuring this out. I wasn't running the proper perfmon. The MSDN documentation should be updated with that information.

# Danny said on September 23, 2008 11:05 AM:

'aspnet_regiis.exe -i' did not produce any error messages.  Based on other research, I realized the registry keys might be wrong, so I did 'aspnet_regiis.exe -u' (to uninstall and delete the registry keys) followed by 'aspnet_regiis.exe -i' (to install and correctly set the keys in the registery).  The EventLog entries immediately ceased

Leave a Comment

(required) 
(optional)
(required) 

Search

Go

This Blog

Syndication

Page view tracker