G
Guest
We are receiving the following error on XP Embedded only
when calling the C#
System.Diagnostics.Process.GetProcessesByName method:
D:\_WTA>calc_test_process.exe
System.InvalidOperationException: Process performance
counter is disabled, so th
e requested operation cannot be performed.
at System.Diagnostics.NtProcessManager.GetProcessInfos
(PerformanceCounterLib
library)
at System.Diagnostics.NtProcessManager.GetProcessInfos
(String machineName, Bo
olean isRemoteMachine)
at System.Diagnostics.ProcessManager.GetProcessInfos
(String machineName)
at System.Diagnostics.Process.GetProcessesByName(String
processName, String m
achineName)
at System.Diagnostics.Process.GetProcessesByName(String
processName)
at Calc_Test_Process.Class1.Main(String[] args)
This is using a small test program recommended by a
previous post:
try
{
Process [] localByName =
Process.GetProcessesByName("calc");
Console.WriteLine
(localByName.Length);
}
catch(Exception ex)
{
Console.WriteLine
(ex.ToString());
}
The code works fine on Windows 2000 / NT Manager
Workstation. Running Performance Monitor shows the
counters ok, and searching the registry for: "Disable
Performance Counters" set to 1 yields no results.
Any idea?
Thanks,
Burkhard
SQA Tester
when calling the C#
System.Diagnostics.Process.GetProcessesByName method:
D:\_WTA>calc_test_process.exe
System.InvalidOperationException: Process performance
counter is disabled, so th
e requested operation cannot be performed.
at System.Diagnostics.NtProcessManager.GetProcessInfos
(PerformanceCounterLib
library)
at System.Diagnostics.NtProcessManager.GetProcessInfos
(String machineName, Bo
olean isRemoteMachine)
at System.Diagnostics.ProcessManager.GetProcessInfos
(String machineName)
at System.Diagnostics.Process.GetProcessesByName(String
processName, String m
achineName)
at System.Diagnostics.Process.GetProcessesByName(String
processName)
at Calc_Test_Process.Class1.Main(String[] args)
This is using a small test program recommended by a
previous post:
try
{
Process [] localByName =
Process.GetProcessesByName("calc");
Console.WriteLine
(localByName.Length);
}
catch(Exception ex)
{
Console.WriteLine
(ex.ToString());
}
The code works fine on Windows 2000 / NT Manager
Workstation. Running Performance Monitor shows the
counters ok, and searching the registry for: "Disable
Performance Counters" set to 1 yields no results.
Any idea?
Thanks,
Burkhard
SQA Tester