C# Vista Issue

I am not sure if this is the correct location but I am getting an exception when I am running this piece of code in Windows Vista while logged in as a user:

System.Diagnostics.Process.GetProcessesByName( proc, System.Environment.MachineName)

Is there a different way to run this I am using .NET 1.1 framework for development.



Answer this question

C# Vista Issue

  • Jason W158421

    I am not sure if this is the answer but what I found on another forum is to add the user to the "Performance Monitor Users" group. I will check with the client getting the bug and make sure this is the fix before I mark it as the answer.


  • Zerrin

    Here is the error message I am getting:

    Couldn't get process information from remote machine --> Access is denied

    And this is called from System.Diagnostics.NtProcessManager.GetProcessInfos(System.Diagnostics.PerformanceCounterLib library)


  • R.Tutus

    Do you have a good web reference for me to look at to see how I would grant "admin" access to the user or at least prompt them for the admin password


  • amicalrahul

    Hi,

    what is the error you are getting I am guessing a security exception. Most likely in XP you were logged in as the administrator, in Vista you run as a normal user even if you are part of the administrators group, you will need to set the appropriate security permissions in your code to be allowed to see what processes are running.

    Mark.



  • C# Vista Issue