System.Diagnostics.Process.GetProcessesByName() - Exception

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • rollasoc

    #1

    System.Diagnostics.Process.GetProcessesByName() - Exception

    Hi,

    One of our customers seem to be having an issue with our software getting
    the following exception on running the app.

    'System.Invalid OperationExcept ion', with the message "Process performance
    counter is disabled, so the requested operation
    cannot be performed."

    (System.Diagnos tics.Process.Ge tProcessesByNam e() seems to be the function it
    excepts on)

    I've done a look on google and found the following message from MS support

    "It is because one performance counter used to retrieve processes are
    disabled. To fix it, you try removing the "Disable Performance Counters"
    entry from the following registry entry:

    HKEY_LOCAL_MACH INE\SYSTEM\Curr entControlSet\S ervices\PerfPro c\Performance

    You may refer to the following two Knowledge Base articles to get more
    information about enabling and disabling performance monitors:

    PRB: Performance Object Is Not Displayed in Performance Monitor


    INFO: Controlling the Disabling of Performance Monitor Extensions


    I hope this helps you.

    Best regards,

    Lion Shi [MSFT]
    MCSE, MCSD
    Microsoft Support Engineer"

    We've managed to repeat the problem here with disabling the Performance
    counters.

    The customer has checked and the Performance counters are not disabled.
    The customer has also explicitly changed the registry to enable performance
    counters.

    So after more searching on google...

    I've asked the customer to (given the time difference, this may take a
    while)

    1) Check whether the pagefiel has been disabled or not, since this can turn
    off the performance counters. Need to ensure it is enabled.
    Control Panel -> System -> Advanced -> Performance Settings -> Advanced ->
    Change

    2) Check or send me the event logs for the PC.
    When a perfmon crashes or doesn't report data for a while Windows disables
    it and leaves it disabled.

    3) Check the status of PerfMon and enable/disable them using the
    exctrlst.exe tool from MS, its part of Windows 2000 resource kit.

    The customer is running XP Home edition on the offending machine. The
    software works fine on other machines (so far).

    Has anybody got any other ideas on what I should be looking into to solve
    this problem?

    Rollasoc










Working...