473,394 Members | 1,755 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Process performance counter is disabled

Max
I'm trying to get the process id of some application and I get an error for this line:

Process [] myApplications= Process.GetProcessesByName("MyApplication");

The error says:

System.InvalidOperationException: Process performance counter is disabled, so the requested operation cannot be performed.
at System.Diagnostics.NtProcessManager.GetProcessInfo s(PerformanceCounterLib library)
at System.Diagnostics.NtProcessManager.GetProcessInfo s(String machineName, Boolean isRemoteMachine)
at System.Diagnostics.ProcessManager.GetProcessInfos( String machineName)
at System.Diagnostics.Process.GetProcessesByName(Stri ng processName, String machineName)
at System.Diagnostics.Process.GetProcessesByName(Stri ng processName)

How can I enable the performance counters? Is this required on all computers on which my application will run?

Cheers,
Max

Nov 17 '05 #1
1 8463
check oput the following link, we had a similar problem and the link at
bottom helped:

http://weblogs.asp.net/nunitaddin/ar...21/267559.aspx
http://msdn.microsoft.com/netframewo...aspx#Question7

HTH

Ollie Riches

"Max" <ma******@yahoo.com> wrote in message
news:OV*************@TK2MSFTNGP15.phx.gbl...
I'm trying to get the process id of some application and I get an error
for this line:

Process [] myApplications= Process.GetProcessesByName("MyApplication");

The error says:

System.InvalidOperationException: Process performance counter is disabled,
so the requested operation cannot be performed.
at
System.Diagnostics.NtProcessManager.GetProcessInfo s(PerformanceCounterLib
library)
at System.Diagnostics.NtProcessManager.GetProcessInfo s(String machineName,
Boolean isRemoteMachine)
at System.Diagnostics.ProcessManager.GetProcessInfos( String machineName)
at System.Diagnostics.Process.GetProcessesByName(Stri ng processName,
String machineName)
at System.Diagnostics.Process.GetProcessesByName(Stri ng processName)

How can I enable the performance counters? Is this required on all
computers on which my application will run?

Cheers,
Max

Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Raj | last post by:
Hi! Every time my applicaiton call "System.Diagnosis.Process.GetProcesses() and some other related APIs in dotnet framework, it throws the following exception: "An unhandled exception of type...
0
by: rollasoc | last post by:
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...
77
by: Charles Law | last post by:
Hi guys I have a time critical process, running on a worker thread. By "time critical", I mean that certain parts of the process must be completed in a specific time frame. The time when the...
0
by: Lukas Egger | last post by:
Hi guys I work with Threads. Unfortunately I have generated too many threads and the program crushed. Now when I work with Process (Process.GetProcessesByName() or other Process functions) I...
0
by: Gaby | last post by:
Hi all, I’ve made a procedure to find a specific process. This works fine under XP or 2000 but not work under xp embedded. Any idea why? See procedure: static public bool IsRunning(string...
5
by: Rob R. Ainscough | last post by:
I'm using the Diagnostics.Process approach to shelling out run the following: C:\Windows\System32\MSIEXEC.EXE /x {73F1BDB7-11E1-11D5-9DC6-00C04F2FC33B} /q ..FileName =...
0
by: 5000wpm | last post by:
"couldn't get process information from remote machine" - Access denied Using VS2003 VB.NET 1.1 under Windows XP Pro x64. Hi, Having recently upgraded to Windows XP Pro x64 a problem has...
1
by: JSha | last post by:
Hello, The application I am using works on most machines except one where in it throws the following exception... Error: Process Performance Counter is Disabled, so requested operation cannot...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.