none
"Can't load counters" in Perfmon when adding counters with lodctr RRS feed

  • Question

  • Hey,

    I'm working with C/C++ in windows 7 64 bit and was trying to add my own performance counter using the version 2.0 counter framework (http://msdn.microsoft.com/en-us/library/aa965334(v=VS.85).aspx).  Whatever i did, in perfmon (when trying to add my counter) my counter set was always shown with it's GUID and not the given name in the manifest file.  Also, when selecting my counterset it always showed "Can't load counters".  I searched for a day on this and already had a feeling that it was some kind of problem with admin rights.  It seems that running lodctr with a user that has administrator rights is not enough, although lodctr returns a successful completion of the addition of the counter set.  When adding my user to the "Performance Monitor Users" and "Performance Log Users" group, my counter set was finally shown correctly in perfmon.

    I hope this info will help others because this isn't mentioned in the counter documentation (or not very visible).

     

    Wednesday, November 3, 2010 10:56 AM

All replies

  • Also, I had to set the complete path to the exe file in the manifest for things to work.  Even if I have the manifest file and the exe file in the same folder and then run lodctr with the complete exe path in the arguments...
    Wednesday, November 3, 2010 12:49 PM
  • Hi,

    I am having the exact same problem. I followed the steps above except adding the path in the manifest. Using ManGen, it does not seem to provide a path field for the counters manifest. How did you do that?

    I ran the lodctr /q on my service name but it does not seem to be listed. I made sure the service is running under admin privs. The lodctr /m: command passed. But, I still have the GUID showing up in the PM tool and cannot load the counters.

    I googled everywhere, and no one else seems to be having this problem. I am running on a Windows 7, 32 bit, in VM mode.

    Thanks.


    Monday, October 31, 2011 5:32 PM
  • Just to copy and paste the solution from the first post:

    When adding my user to the "Performance Monitor Users" and "Performance Log Users" group, my counter set was finally shown correctly in perfmon


    RPA
    Saturday, November 12, 2011 8:24 AM
  • I'm having a problem viewing the performance counters I created. They show up as GUIDs and show the same "can't load counters'. I followed the steps to change permision (performance monitor users and performance log users) and I'm still having the same problem. What else could be the issue?
    Monday, February 13, 2012 8:20 PM
  • Hi Robert,

    you can use the windows security eventlog and check for access denied messages / missing permissions.
    Or use Procmon and check for access denied messages.

    Best regards


    RPA

    Tuesday, February 21, 2012 8:33 PM
  • Hello,

    I'm having the same problem as above, and after doing the suggested tricks (as follows), I still can see only my counter set's GUID and the "Can't load counters" message when expanded:

    1- adding my user to the "Performance Monitor Users" and "Performance Log Users" group. Log out and log back in for settings to take effect.

    2- Set the complete path to the exe file in the manifest for things to work

    3- windows security eventlog and check for access denied messages / missing permissions: no such messages

    System: Windows 7 64-bit 


    • Edited by Ehsan P Monday, July 9, 2012 2:58 PM
    Monday, July 9, 2012 2:43 PM
  • Hello,

    I'm having the same problem as above, and after doing the suggested tricks (as follows), I still can see only my counter set's GUID and the "Can't load counters" message when expanded:

    1- adding my user to the "Performance Monitor Users" and "Performance Log Users" group. Log out and log back in for settings to take effect.

    2- Set the complete path to the exe file in the manifest for things to work

    3- windows security eventlog and check for access denied messages / missing permissions: no such messages

    System: Windows 7 64-bit 


    I resolved my issue and now my counters load up in perfmon.

    The problem in my case was that I hadn't included in my provider application the ctrpp-generated rc file which contained the necessary strings for counter registration.

    Thought it might be useful for anyone experiencing this symptom.


    • Edited by Ehsan P Tuesday, July 10, 2012 5:53 PM
    Tuesday, July 10, 2012 5:48 PM
  • One more thing I noticed, when including the generated resources in a project that also has a string table, the language specified for the string table must all be the default one.

    I had a string table in UK English, I added the .rc file and built. LodCtr installed the dll ok, but only the guid would show in the perfmon list. Putting the UK string table in a default block fixed this.

    Tuesday, October 7, 2014 7:39 AM