Users sometimes begin to see Event ID 1020 or 1008 Microsoft-Windows-Perflib error in the Event Viewer of Windows 11/10 for no apparent reason. More importantly, they have no idea how to repair it. The error message looks something like this –
Event ID 1008
The Open Procedure for service “.NETFramework” in DLL “C:\WINDOWS\system32\mscoree.dll” failed with error code The system cannot find the file specified. Performance data for this service will not be available.
Event ID 1020
The required buffer size is greater than the buffer size passed to the Collect function of the “C:\Windows\System32\perfts.dll” Extensible Counter DLL for the “LSM” service. The given buffer size was 34184 and the required size was 43160.
Resolving this issue requires some work. After you have created a system restore point, follow the instructions given below to fix it.
Event ID 1020 or 1008 Microsoft-Windows-Perflib error
Event IDs 1020 and 1008 are being reported because a list of counters is corrupt and a required DLL is disabled. When the performance counter cannot unload the strings for the specified service, the registry might get corrupted and show Error 1020. To fix this issue, rebuild the list of performance counters.
- Click Start.
- Type CMD in the search bar.
- Right-click Command Prompt.
- Choose Run as administrator.
- Enter the following command and hit Enter key–
CD %SYSTEMROOT%\System32
- At the command prompt, type
lodctr /r
. - Press ENTER.
- Similarly for error 1008, type
lodctr /e:<DLL name
> and then press ENTER.
Please note that the Membership in the local Administrators group is required to complete this procedure. To rebuild the list of counters in the registry, do the following.
Click on the Windows Start button.
In the Search box that appears, type CMD or Command Prompt.
When the option is seen, right-click it and select Run as administrator option.
Now, in the Command Prompt window that appears on your screen, enter the following command and hit Enter key – cd %SYSTEMROOT%\System32
.
Again enter the following command and hit Enter key – lodctr /r
.
Similarly, 1008 Microsoft-Windows-Perflib error occurs when the required DLL is disabled. To resolve the issue, type lodctr /e:</<DLL name
> and then press ENTER (replace <DLL name> with the file name of the library).
I hope this helped.