Reputation: 405
I have a small C# application which internally uses several SCM API's for example OpenService. As such this is an applicaiton which i know requires administrative rights to run properly. I have been successfully debugging this application in visual studio 2012 by running Visual Studio with administrative access. This meant any processes started by the Visual Studio debugger were also started with elevated access.
After installing VS 2012 update 2 this no longer works. It seems even if you start visual studio with administrative rights debugged processes are not started with administrative access. Anyone else having this problem or know a way around it?
Operating System: Windows 8 (fully updated as of 4/13/2012)
Upvotes: 1
Views: 139
Reputation: 8455
I have Visual Studio Ultimate 2012 version 11.0.60315.01 Update 2 installed and tested it using following console application project:
`class Program {
[DllImport("shell32.dll")]
public static extern bool IsUserAnAdmin();
static void Main(string[] args)
{
Console.WriteLine("Elevated: " + IsUserAnAdmin());
Console.ReadLine();
}
}`
When started from non-elevated Visual Studio output is 'Elevated: false' When started from elevated Visual Studio output is 'Elevated: true'
Are you getting same results?
Upvotes: 2