Vista Compatibility Team Blog

GetCurrentProcess fails on Net 1.1 on Vista

This little snippet compiled with .Net 1.1:

using System;

using System.Diagnostics;

   

class Program

{

    static void Main(string[] args)

    {

        try

        {

            Process c = Process.GetCurrentProcess();

   

            Process[] p = Process.GetProcessesByName(c.ProcessName);

        }

        catch (Exception e)

        {

            Console.WriteLine(e.Message);

        }

    }

}

   

will fail on Vista as standard user and hence filtered admin with this error:

{"Couldn't get process information from remote machine."}

Compiling it under 2.0 will get you passed it.

   

Maarten

Published Wednesday, April 18, 2007 2:34 AM by VistaCompatTeam

Comments

 

dpletea said:

One solution for this code to work is to disable the UAC (User Acess Control). I am having this issue to an aplication that I developing right now and looking for altenative solutions without disabling UAC.

--- Dan

July 12, 2007 10:38 AM
Anonymous comments are disabled

© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Microsoft
Page view tracker