I’m running Visual Studio 2008 on Windows 7 64-bit. I’m logged in as administrator, and I’m running it as administrator, but the program I’m working on fails with access denied when I call a restricted API. If run the program from Explorer with “Run as Administrator” it works.
I was under the belief that Visual Studio 2008 debugs programs with whatever rights Visual Studio 2008 itself is running with. As it stands I can’t debug my application due to this, and I’m at a loss as to what’s going on.
I found the answer. It turns out that it is, in fact, a manifest issue: by default if you have a manifest you need to set the appropriate administrator privilege.
The default is
asInvoker, but that doesn’t work if you need elevated privileges; you instead have to set it torequireAdministratorin the manifest properties.