System.Diagnostics.Process.GetProcessesByName() - Exception

R

rollasoc

Hi,

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

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

(System.Diagnostics.Process.GetProcessesByName() 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_MACHINE\SYSTEM\CurrentControlSet\Services\PerfProc\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
http://support.microsoft.com/default.aspx?scid=kb;EN-US;q249138

INFO: Controlling the Disabling of Performance Monitor Extensions
http://support.microsoft.com/default.aspx?scid=kb;en-us;Q248993

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top