D:\_WTA>calc_test_process.exe
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, Bo olean 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 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.
Which counters need to be enabled on our XPe image to have
the method succeed?
Thanks,
Burkhard
SQA Tester
Do you have Pagefile support enabled on your image?
--
Regards,
KM, BSquare Corp.
Yes, the Pagefile support is enabled (set to: 192-512 MB).
Are we missing a component or registry entry we are not
aware of?
Thanks,
Burkhard
>.
>
It is SP1 or SP2 image?
Open the registry section of the "Performance Counter Configuration" component and disable the following registry key:
[HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Perflib\009].
Some more info here: http://support.microsoft.com/?id=300956
Let us know if this fixes the problem.
Thanks,
Burkhard
>.
>
You have to delete the Perflib\009 key.
You can do that in TD in the "Performance Counter Configuration" component's registry section.
Or in the pre-FBA system hive offline.
THANKS A LOT,
Burkhard
>.
>
Well.. I was under impression you were building the image yourself :-)
TD = Target Designer, FBA = Fisrt Boot Agent.
These XPe dev tools do not make sense to you if you are just "fixing" the XPe image that has already been built and deployed for you
by someone else.
Anyway, I am glad that was the fix for you.
Btw, this issue has been fixed in XPe SP2.
We are working with POS systems, and are about to "try-
out" the soon to come new "WePOS" OS from MS (in an
attempt not to having to test SP2...). I'll let my
Integration Dept know.
Thanks again,
Burkhard
>.
>