How to Always Run Visual Studio As Administrator
To jum straight to the solution, click here
“Certain tasks, including debugging and creating local IIS applications, require that you start Visual Studio as a user with Administrative privileges. On Windows Vista, and Windows Server 2008 when not running as the built-in Administrator account, this requires right-clicking the Visual Studio 2008 icon in the Start Menu and choosing Run as administrator.
“To make this process easier, you can create a shortcut and check the Run this program as an administrator check box on the Compatibility tab of the shortcut properties.”
from Using Visual Studio 2008 with IIS 7 @ learn.iis.net
On the last few projects I’ve worked on, we’ve used IIS sites for our development (for a number of reasons I won’t detail here), and the need to open VS in admin mode has been a constant annoyance. It’s like constantly getting bitten by a mosquito. Today I finally got annoyed enough to spend 5 minutes researching a solution. (I know. I procrastinate.)
The solution, or what seems to be working for me so far at least was found at sevenforums.com: How to Run a Program as an Administrator in Windows 7. Some of these options I knew about, the one I hadn’t tried and which worked for me was this:
1. Right click on the
program shortcut orprogram .exe file, then click on Properties, and on the Compatibility tab. (See screenshots below)
NOTE: If you are doing this while logged on as a standard user instead of an administrator, then you will need to also click on the Change settings for all users button and type in the administrator's password.
2. To Always Run this Program as an Administrator -
A) Check the Run this program as an administrator box, and click on OK. (See screenshots above)
The key is to change the compatibility setting of the Visual Studio EXECUTABLE, not the shortcut to it. I.e., on my laptop, I went to C:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\ and right-clicked devenv.exe and then proceeded as above.
I then had to add one more step – when I now clicked on a .sln file, nothing would happen. It appears the default Open action couldn’t run, I assume, due to inadequate privileges. To fix this, I right-clicked the .sln file, selected Open With –> Choose Default Program, and then selected Visual Studio, making sure Always use… was checked.
Presto – my .sln files now open asking to be run as admin, as do my jump list projects.
Labels: asp.net, asp.net mvc, c#, howto, me-me-me, microsoft, usability, visual studio, windows7
An alternative solution to the last step is to check "run as admin" on the version selector too (vslauncher.exe).
By Anonymous, at Tuesday, August 24, 2010 4:32:00 AM
Cool! This is good.
By Anonymous, at Friday, October 08, 2010 8:26:00 PM
Here is a link that provides a good explanation of make the visual studio always run as administrator.
By ASP.NET Solution, at Sunday, November 14, 2010 12:31:00 PM
@ ASP.NET Solution. Right: that would be exactly the same as what I'm saying.
By Anonymous, at Friday, November 19, 2010 4:40:00 PM
Thank you very much, this has been bugging me for a while.
By Brian, at Friday, September 23, 2011 5:16:00 PM
Post a Comment