Aspnet_regiis : unregistering ASP.NET 2.0 may break ASP.NET 4 performance counters

This article has been archived. It is offered "as is" and will no longer be updated.
Symptoms
Performance counters for ASP.NET 4 (or newer versions) may stop working. As a result, when you use certain ASP.NET 4 performance counters, errors such as the following may appear in the application event log:

"Unable to locate the open procedure "%pef_counter_name%" in DLL "%WINDOWS%\Microsoft.NET\Framework\v4.0.30319\aspnet_perf.dll" for the "ASP.NET" service."

"Performance counter data collection from the "ASP.NET" service has been disabled due to one or more errors generated by the performance counter library for that service."
Cause
Unregistering ASP.NET 2.0 on any operating system version where ASP.NET 4 is already registered corrupts some performance counter registrations for ASP.NET 4. This occurs because the ASP.NET 2.0 unregistration process cannot detect that a later version of ASP.NET is installed on the computer.
Resolution

Re-run aspnet_regis.exe -iru from the 4.0 directory.
Please note that on 64-bit machines aspnet_regiis –iru should be run from the 64-bit Framework installation directory
(%windir%\Microsoft.net\Framework64\v4.0.30319).

More Information

ASP.NET Performance counters have generic counters (e.g. ASP.NET and ASP.NET Applications) and versioned counters (e.g. ASP.NET v2.50727 and ASP.NET Apps v2.50727). This allows side-by-side .NET Framework versions with different performance counter implementations. The higher version of the .NET Framework registered on the machine “owns” the generic objects, while all .NET Framework versions “own” their respective versioned counters.
When ASP.NET 2.0 is un-registered it tries to “fix” the generic performance counters, ignoring that there is a higher version of ASP.NET registered. This is a known bug in ASP.NET 2.0.

Note This is a "FAST PUBLISH" article created directly from within the Microsoft support organization. The information contained herein is provided as-is in response to emerging issues. As a result of the speed in making it available, the materials may include typographical errors and may be revised at any time without notice. See Terms of Use for other considerations.
Properties

Article ID: 2023159 - Last Review: 12/12/2015 07:49:30 - Revision: 1.0

Microsoft .NET Framework 2.0, Microsoft .NET Framework 3.5, Microsoft .NET Framework 4

  • kbnosurvey kbarchive KB2023159
Feedback