InvalidOperationException - which counters need to be enabled on our XPe image?

B

Burkhard

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 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
 
B

Burkhard

Hi KM,

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

-----Original Message-----
Burkhard,

Do you have Pagefile support enabled on your image?

--
Regards,
KM, BSquare Corp.

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 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


.
 
K

KM

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.

--
Regards,
KM, BSquare Corp.


Hi KM,

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

-----Original Message-----
Burkhard,

Do you have Pagefile support enabled on your image?

--
Regards,
KM, BSquare Corp.

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 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


.
 
K

KM

And I hope you are trying the code from an account that has Admin privileges.

--
Regards,
KM, BSquare Corp.

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.

--
Regards,
KM, BSquare Corp.


Hi KM,

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

-----Original Message-----
Burkhard,

Do you have Pagefile support enabled on your image?

--
Regards,
KM, BSquare Corp.


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 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



.
 
B

Burkhard

It's SP1 - yes, we are running as a user who is a Computer
Administraor on XPe. The only registry key under:
HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\009
is a Binary key called (Default) with a zero-length binary
value. On my working Windows 2000 this key is a String;
not sure if this makes a difference. I'll try the
suggestion from the article next.

Thanks,
Burkhard



-----Original Message-----
And I hope you are trying the code from an account that has Admin privileges.
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.

--
Regards,
KM, BSquare Corp.


Hi KM,

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


-----Original Message-----
Burkhard,

Do you have Pagefile support enabled on your image?

--
Regards,
KM, BSquare Corp.


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 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



.


.
 
K

KM

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.

--
Regards,
KM, BSquare Corp.

It's SP1 - yes, we are running as a user who is a Computer
Administraor on XPe. The only registry key under:
HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\009
is a Binary key called (Default) with a zero-length binary
value. On my working Windows 2000 this key is a String;
not sure if this makes a difference. I'll try the
suggestion from the article next.

Thanks,
Burkhard



-----Original Message-----
And I hope you are trying the code from an account that has Admin privileges.
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.

--
Regards,
KM, BSquare Corp.



Hi KM,

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


-----Original Message-----
Burkhard,

Do you have Pagefile support enabled on your image?

--
Regards,
KM, BSquare Corp.


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 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



.


.
 
B

Burkhard

What's TD or pre-FBA?
I pressed delete from regedit; that got rid of the \009
key.
After a re-boot, now the code WORKS!!

THANKS A LOT,
Burkhard


-----Original Message-----
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.

--
Regards,
KM, BSquare Corp.

It's SP1 - yes, we are running as a user who is a Computer
Administraor on XPe. The only registry key under:
HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\009
is a Binary key called (Default) with a zero-length binary
value. On my working Windows 2000 this key is a String;
not sure if this makes a difference. I'll try the
suggestion from the article next.

Thanks,
Burkhard



-----Original Message-----
And I hope you are trying the code from an account that has Admin privileges.

--
Regards,
KM, BSquare Corp.


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.

--
Regards,
KM, BSquare Corp.



Hi KM,

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


-----Original Message-----
Burkhard,

Do you have Pagefile support enabled on your image?

--
Regards,
KM, BSquare Corp.


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 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



.





.


.
 
K

KM

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.

--
Regards,
KM, BSquare Corp.

What's TD or pre-FBA?
I pressed delete from regedit; that got rid of the \009
key.
After a re-boot, now the code WORKS!!

THANKS A LOT,
Burkhard


-----Original Message-----
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.

--
Regards,
KM, BSquare Corp.

It's SP1 - yes, we are running as a user who is a Computer
Administraor on XPe. The only registry key under:
HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\009
is a Binary key called (Default) with a zero-length binary
value. On my working Windows 2000 this key is a String;
not sure if this makes a difference. I'll try the
suggestion from the article next.

Thanks,
Burkhard




-----Original Message-----
And I hope you are trying the code from an account that
has Admin privileges.

--
Regards,
KM, BSquare Corp.


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.

--
Regards,
KM, BSquare Corp.



Hi KM,

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


-----Original Message-----
Burkhard,

Do you have Pagefile support enabled on your image?

--
Regards,
KM, BSquare Corp.


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 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



.





.


.
 
B

Burkhard

KM,

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

-----Original Message-----
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.

--
Regards,
KM, BSquare Corp.

What's TD or pre-FBA?
I pressed delete from regedit; that got rid of the \009
key.
After a re-boot, now the code WORKS!!

THANKS A LOT,
Burkhard


-----Original Message-----
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.

--
Regards,
KM, BSquare Corp.


It's SP1 - yes, we are running as a user who is a Computer
Administraor on XPe. The only registry key under:
HKLM\SOFTWARE\Microsoft\Windows
NT\CurrentVersion\Perflib\009
is a Binary key called (Default) with a zero-length binary
value. On my working Windows 2000 this key is a String;
not sure if this makes a difference. I'll try the
suggestion from the article next.

Thanks,
Burkhard




-----Original Message-----
And I hope you are trying the code from an account that
has Admin privileges.

--
Regards,
KM, BSquare Corp.


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.

--
Regards,
KM, BSquare Corp.



Hi KM,

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


-----Original Message-----
Burkhard,

Do you have Pagefile support enabled on your image?

--
Regards,
KM, BSquare Corp.


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 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



.





.



.


.
 

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