r@ds

my vb.net application that runs fine on XP , 2000 is giving " access denied " error on vista for -> getprocesses(local machine name).

I tried passing the local machine name , IP address but it stills gives the access denied error.

The processes to be returned are from local machine on which the application is running , not for a remote machine.Also the user account on vista is of administrator type.

Any ideas how to get around this

This is the error listing -

Couldn't get process information from remote machine

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.InvalidOperationException: Couldn't get process information from remote machine. ---> System.ComponentModel.Win32Exception: Access is denied
at System.Diagnostics.PerformanceMonitor.GetData(String item)
at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String item)
at System.Diagnostics.PerformanceCounterLib.get_CategoryTable()
at System.Diagnostics.PerformanceCounterLib.GetPerformanceData(String[] categories, Int32[] categoryIndexes)
at System.Diagnostics.NtProcessManager.GetProcessInfos(PerformanceCounterLib library)
--- End of inner exception stack trace ---
at System.Diagnostics.NtProcessManager.GetProcessInfos(PerformanceCounterLib library)
at System.Diagnostics.NtProcessManager.GetProcessInfos(String machineName, Boolean isRemoteMachine)
at System.Diagnostics.ProcessManager.GetProcessInfos(String machineName)
at System.Diagnostics.Process.GetProcesses(String machineName)
at System.Diagnostics.Process.GetProcesses()
at DeMenu.frmMainDahbashiMenu.exitmnu_Click(Object sender, EventArgs e)
at System.Windows.Forms.MenuItem.OnClick(EventArgs e)
at System.Windows.Forms.MenuItemData.Execute()
at System.Windows.Forms.Command.Invoke()
at System.Windows.Forms.Control.WmCommand(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ScrollableControl.WndProc(Message& m)
at System.Windows.Forms.ContainerControl.WndProc(Message& m)
at System.Windows.Forms.Form.WndProc(Message& m)
at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)


************** Loaded Assemblies **************
mscorlib
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase:
file:///c:/windows/microsoft.net/framework/v1.0.3705/mscorlib.dll
----------------------------------------
DeMenu
Assembly Version: 1.0.2611.35370
Win32 Version: 1.0.2611.35370
CodeBase:
file:///C:/DENET/DeMenu.exe
----------------------------------------
System.Data
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase:
file:///c:/windows/assembly/gac/system.data/1.0.3300.0__b77a5c561934e089/system.data.dll
----------------------------------------
System
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase:
file:///c:/windows/assembly/gac/system/1.0.3300.0__b77a5c561934e089/system.dll
----------------------------------------
Microsoft.VisualBasic
Assembly Version: 7.0.3300.0
Win32 Version: 7.00.9466
CodeBase:
file:///c:/windows/assembly/gac/microsoft.visualbasic/7.0.3300.0__b03f5f7f11d50a3a/microsoft.visualbasic.dll
----------------------------------------
System.Windows.Forms
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase:
file:///c:/windows/assembly/gac/system.windows.forms/1.0.3300.0__b77a5c561934e089/system.windows.forms.dll
----------------------------------------
System.EnterpriseServices
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase:
file:///c:/windows/assembly/gac/system.enterpriseservices/1.0.3300.0__b03f5f7f11d50a3a/system.enterpriseservices.dll
----------------------------------------
System.Drawing
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase:
file:///c:/windows/assembly/gac/system.drawing/1.0.3300.0__b03f5f7f11d50a3a/system.drawing.dll
----------------------------------------
System.Xml
Assembly Version: 1.0.3300.0
Win32 Version: 1.0.3705.0
CodeBase:
file:///c:/windows/assembly/gac/system.xml/1.0.3300.0__b77a5c561934e089/system.xml.dll
----------------------------------------



Re: Application Compatibility for Windows Vista vb.net application : getprocesses() gives access denied

Bruce N. Baker - MSFT

Start out by running the application in XP2 compatability mode but this sounds like your bumping into a UAC related issue.






Re: Application Compatibility for Windows Vista vb.net application : getprocesses() gives access denied

Mo Nail - MFST

If you are using .NET 1.1, be sure that SP1 is installed.

Also, try running your application elevated (right-click on the EXE and chose "Run as Administrator").






Re: Application Compatibility for Windows Vista vb.net application : getprocesses() gives access denied

Bruce N. Baker - MSFT

I'm unable to repro this running VS 2005 in Administrator mode, with or without the server param.

Try right clicking and doing what Monty said and running your application as administrator.






Re: Application Compatibility for Windows Vista vb.net application : getprocesses() gives access denied

rm

Thanks Bruce ,

The access error does not occur when running the application in XP2 compatability mode.

Is there any other solution to this problem

UAC is currently turned off.

Running as administrator doesnt help.





Re: Application Compatibility for Windows Vista vb.net application : getprocesses() gives access denied

Bruce N. Baker - MSFT

UAC off is definately not a good plan or solution anyway.

Accessing all processes is a admin task as far as I know, you might try to get a subset of that, that you are allowed to access.

To illustrate: If you click on task manager in Vista you see a box that says "show all processes". In user mode you only see your processes, if you click on that, the program "elevates" and you see all the process (after going though elevation prompts).

I'm not sure of which API or params to use to just get the local user processes but I'll find that out if you need it.






Re: Application Compatibility for Windows Vista vb.net application : getprocesses() gives access denied

rm

UAC is now turned on and the application is running in XP compatibility mode without error.

Could you let me know which params to use to just get the local user processes.

Also , just wanted to mention that the application was developed on XP with .NET framework 1.1 .

Another concern is , that if I develop my application on Vista with .NET framework 3.0 ,

will they work without a problem on pc's with .NET framework 1.1

Are there any namespaces or procedures i should avoid using

Thanks for your prompt replies....





Re: Application Compatibility for Windows Vista vb.net application : getprocesses() gives access denied

david chow

Acturally with VS 2005 you can query the processes even if you don't run the app in administrator.

The question is, the app is based on .NET framework 1.1 and it can not query the processes even if SP1 is installed.

Is there any other way to get the process information with .NET framework 1.1

We have to update to 2.0