locked
Enable Process Performance Counters

    Question

  •  

    In Windows Vista Ultimate I am getting an error message:

     

    CheckForNew()

    Process Performance counter is disabled, so the requested operation cannot be performed.

     

    I've not been able resolve this.  Anyone guide me?

     

    Wednesday, October 03, 2007 9:33 PM

Answers

All replies

  • I'm not familiar with "CheckForNew()." Is this some function you've implemented or a Windows API? If it's the former, can you describe what the function does? Perhaps you could provide more details about your particular problem, including the high-level goal(s) you're trying to achieve, and we can answer your question, or route it appropriately.

     

    Regards,
    Jon

    Thursday, October 04, 2007 3:47 PM
    Owner
  • This error occurs immediately when starting my app.  The app will not continue to run after clearing the error dialog.

     

    The CheckForNew is my function.  This basically polls to determine if there is a more current software version of our app.

     

    I suspect there is a registry setting, maybe a system check box to "enable" Process Performance Counters, but I can't find it.  I just want to get rid of the error message.

    Thanks,

    Dan

    Friday, October 05, 2007 5:23 AM
  • It would be interesting to see the stack trace from the exception you're getting, but in the meantime, check the following forum thread: http://forums.microsoft.com/MSDN/ShowPost.aspx?PostID=284746&SiteID=1
     

    Regards,

    Jon

    Friday, October 05, 2007 6:57 PM
    Owner
  • Thanks for the direction.  I reviewed the post above and checked the registry.  This did not resolve my error.  I deleted the PerfProc key altogether, rebooted and still receive the error.

     

    ************** Exception Text **************
    System.InvalidOperationException: Process performance counter is disabled, so the requested operation cannot be performed.
       at System.Diagnostics.NtProcessManager.GetProcessInfos(PerformanceCounterLib library)
       at System.Diagnostics.NtProcessManager.GetProcessInfos(String machineName, Boolean isRemoteMachine)
       at System.Diagnostics.ProcessManager.GetProcessInfos(String machineName)
       at System.Diagnostics.Process.GetProcessesByName(String processName, String machineName)
       at System.Diagnostics.Process.GetProcessesByName(String processName)
       at SHOUpdateManager.Updater.KillAppIfAppOpen()
       at SHOUpdateManager.FormUpdateManager.btnInstall_Click(Object sender, EventArgs e)
       at System.Windows.Forms.Control.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnClick(EventArgs e)
       at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
       at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
       at System.Windows.Forms.Control.WndProc(Message& m)
       at System.Windows.Forms.ButtonBase.WndProc(Message& m)
       at System.Windows.Forms.Button.WndProc(Message& m)
       at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
       at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
       at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


    ************** Loaded Assemblies **************
    mscorlib
        Assembly Version: 1.0.5000.0
        Win32 Version: 1.1.4322.2407
        CodeBase: file:///c:/windows/microsoft.net/framework/v1.1.4322/mscorlib.dll
    ----------------------------------------
    ----------------------------------------
    System
        Assembly Version: 1.0.5000.0
        Win32 Version: 1.1.4322.2407
        CodeBase: file:///c:/windows/assembly/gac/system/1.0.5000.0__b77a5c561934e089/system.dll
    ----------------------------------------
    System.Drawing
        Assembly Version: 1.0.5000.0
        Win32 Version: 1.1.4322.2032
        CodeBase: file:///c:/windows/assembly/gac/system.drawing/1.0.5000.0__b03f5f7f11d50a3a/system.drawing.dll
    ----------------------------------------
    System.Xml
        Assembly Version: 1.0.5000.0
        Win32 Version: 1.1.4322.2032
        CodeBase: file:///c:/windows/assembly/gac/system.xml/1.0.5000.0__b77a5c561934e089/system.xml.dll
    ----------------------------------------

    Monday, October 08, 2007 9:33 PM