I'm trying to monitor my database connections with Performance Monitor, but for some reason I can no longer add the counters.
Every set of counters OTHER than the two .NET Data Providers (for Oracle and SQL Server) works fine.
This was working not 10 minutes ago, when it just stopped. I've tried rebooting the box, which made no difference.
An suggestions on how to figure out how to re-enable these?
Here's the solution:
Open cmd and run these commands:
Note: It seems that if you're running the profiler, and kill IIS without stopping it first, you get this problem.
Note: the accepted answer does not appear to apply to Windows 7 x64.
It seems that on the newer platform, netfxperf.dll isn't a COM dll at all. Therefore, using regsvr32 on it isn't going to work. This can be verified using several techniques - checking the registry, running Dumpbin, using Dependency Walker among others.
For me, rebuilding my performance counters (lodctr /R) as described here and rebooting fixed the problem.
I had this problem once as well. Windows seems to disable performance counters after a certain number of failures have occurred while trying to open them. I overrode this and never had a problem again by deleting the registry key.
Open regedit, and look under HKLM\SYSTEM\CurrentControlSet\Services.NET Data Provider for SqlServer\Performance. I can't recall the exact key name (DisablePerformanceCounters?), but its name will jump out at you as contributing to why it's disabled. Delete the key. I think it will take effect on the fly, but you may need to reboot.
I know this sounds a bit sketchy, especially as I can't recall the key name, but I know I saw this behavior and deleting the key fixed it for me.