77

I am using C# and WPF - Operating System is windows 7 Professional and Visual Studio 2012, SQL Server 2012.

I used Devexpress Grid in wpf. I want to bind it to database using ADO.Net Server mode. I selected "Items Source Wizard" Option to do this binding but it generated following Exception:

InvalidOperationException: Cannot load Counter Name data because an invalid index '' was read from the registry.

What does this exception mean?

Can you please help me to resolve this issue.

Thanks, Annie.

4 Answers 4

118

Although this has already been answered, I see people are repeatedly getting the same error that I did when trying to solve it. If when you run:

C:\windows\system32> lodctr /r

you get the error

Error: Unable to rebuild performance counter setting from system backup store, error code is 2

then you instead need to run

C:\windows\SysWOW64> lodctr /r

after which you should get

Info: Successfully rebuilt performance counter setting from system backup store

Note this has to be done as administrator. I found the solution here

5
  • Worked perfectly. Thanks! Jun 14, 2015 at 3:42
  • 1
    Yep, first time error -- Second time resolved C:\Windows\system32>lodctr /r Error: Unable to rebuild performance counter setting from system backup store, error code is 2 C:\Windows\system32>lodctr /r Info: Successfully rebuilt performance counter setting from system backup store Jul 31, 2015 at 23:04
  • I had same problem while running SSIS package. Executing lodctr /r solved the problem. Sep 9, 2016 at 7:05
  • 3 years after last post, 6 years after question, I had this error on a Windows 7 machine trying to run Intel Processor Diagnostics Tool (IPDT). The fix(es) worked. Thanks! Jun 16, 2019 at 16:40
  • I did not have the folder SysWOW64, but running it from C:\Windows> solved the issue! Mar 26, 2021 at 14:48
104

Just had that message related to Microsoft Dynamics CRM updates not installing and the marked answer for this post helped greatly:

Click Start, type cmd right click cmd.exe, and select Run as administrator. At the prompt, type lodctr /r and press ENTER.

Apparently, Windows keeps some counters cache in the registry at HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009 \ Counter+Help. If this cache becomes corrupted (has blank lines), you get the above errors - and lodctr /r rebuilds that cache.

3
  • 3
    I get: "Error: Unable to rebuild performance counter setting from system backup store, error code is 5PS"
    – tdc
    Jun 25, 2014 at 8:32
  • 2
    @tdc you need to run from an elevated prompt
    – Simon
    Oct 15, 2014 at 21:35
  • 2
    @tdc, you have to close VS or in my case, close the ui recording in the down right edge of your screen
    – Legends
    Apr 25, 2015 at 12:47
12
  1. Go to Start, type cmd.

  2. Right-click on cmd.exe and choose ‘Run as administrator’.

  3. Type lodctr /r and press enter.

You will then get the message ‘Info: Successfully rebuilt performance counter setting from system backup store’.

  1. Check if there are providers that are disabled, write lodctr /q and press enter

  2. You will then get a long list of providers, make sure that the [CRM Client] is Enabled, see below

If not, write lodctr /e:CRM Client and press enter.

  1. Install the Microsoft Dynamics CRM for Outlook client Update Rollup
1
  1. Run command prompt as admin.

  2. Type LODCTR /r

  3. Wait a few seconds to discard it Error: Unable to reset the performance counter from the system backup storage. Error code 2.

Retype LODCTR / r this time it is working successfully.

Your Answer

Reminder: Answers generated by Artificial Intelligence tools are not allowed on Stack Overflow. Learn more

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.