Freigeben über


Visual Studio Permissions Needed on Windows Vista or Later

Versions:  2005,2008,2010
Published:  12/3/2010
Code:  vstipEnv0056

 

There seems to be a popular misconception that you need to have Administrator privileges to use Visual Studio.  While this is true in some cases it isn't true in all of them.  So when do you need to run Visual Studio as an administrator and when don't you?  Here is some guidance:

 

 

Installing Visual Studio (All Versions)

You need Administrator rights to install Visual Studio. 

 

 

Running Visual Studio 2005

To run VS2005 on Windows Vista or later you will be prompted to run as Administrator when you start the application.  This version of Visual Studio requires that you use Administrative rights to use it.

 

 

 

Specific Scenarios for Visual Studio 2008/2010

Web / Internet Information Services

Creating a new local or remote IIS Web site project - You cannot make changes to the Internet Information Services (IIS) metabase (for example, creating new entries) because it requires administrative privileges. This affects your ability to configure some settings in the Web.config file.

 

Opening a local or remote IIS Web site project - You cannot run your Web site unless you use the ASP.NET Development Server, which is the default Web server for file-system Web sites. Alternatively, you can set project options to open the browser and point to the Web site using IIS.

 

Debugging a local or remote IIS Web site project - You cannot attach to a process that is running under the IIS worker process because it requires administrative privileges.

 

More information can be found here:  https://msdn.microsoft.com/en-us/library/ms178112(v=VS.90).aspx

 

 

 

Windows Installer Deployment

Windows Installer technology supports software installation on the Windows Vista (or later) operating system. The end user installing applications on Windows Vista should receive prompts only for each component installation that requires elevation, even when the user's computer runs under User Account Control (UAC).

 

More information can be found here:  https://msdn.microsoft.com/en-us/library/Bb384154(v=VS.100).aspx

 

 

 

Click-Once Deployment

Windows Installer deployment requires administrative permissions and allows only limited user installation; ClickOnce deployment enables non-administrative users to install and grants only those Code Access Security permissions necessary for the application.

 

More information can be found here:  https://msdn.microsoft.com/en-us/library/t71a733d.aspx

 

 

 

Code

Some code requires Administrator access in order to execute. If possible, alternatives to this code should be pursued. Examples of code operations that require Administrator access are:

  • Writing to protected areas of the file system, such as the Windows or Program Files directories

  • Writing to protected areas of the registry, such as HKEY_LOCAL_MACHINE

  • Installing assemblies in the Global Assembly Cache (GAC)

Generally, these actions should be limited to application installation programs. This allows users to use administrator status only temporarily.

 

More information can be found here:  https://msdn.microsoft.com/en-us/library/ms173360(v=VS.100).aspx

 

 

 

Debugging

According to the documentation, "[y]ou can debug any applications that you launch within Visual Studio (native and unmanaged) as a non-administrator by becoming part of the Debugging Group. This includes the ability to attach to a running application using the Attach to Process command. However, it is necessary to be part of the Administrator Group in order to debug native or managed applications that were launched by a different user."

 

More information can be found here:  https://msdn.microsoft.com/en-us/library/ms173360(v=VS.100).aspx

 

 

 

COM / COM Interop

Classic COM

  • When you add a classic COM control, such as an .ocx control, to the Toolbox, Visual Studio tries to register the control. You must have administrator credentials to register the control.

  • Add-ins written by using classic COM have to be registered to work in Visual Studio. You must have administrator credentials to register the control.

COM Interop

When you build managed components, and you have selected "Register for COM Interop" the managed assemblies have to be registered. You must have administrator credentials to register the assemblies.

 

More information can be found here:  https://msdn.microsoft.com/en-us/library/ms165100(v=VS.90).aspx

Comments

  • Anonymous
    December 02, 2010
    Wasn't there a service pack for VS2005 which removed the Vista-admin requirement for general usage? Maybe I'm thinking of VS2008, but that would have come out after Vista so I'm leaning towards VS2005. My memory is rusty, though. :)

  • Anonymous
    December 03, 2010
    To run Windows Azure VS2010 projects, you do need Admin rights.

  • Anonymous
    December 05, 2010
    The comment has been removed

  • Anonymous
    December 05, 2010
    Leo -- I think there was a service pack for Vista that did make the annoying dialog go away. Daniel -- I just installed VS2005 on a new machine the other day and changed the properties of the shortcut to run as administrator on the compatability tab.  I don't get the message anymore.  Give that a shot. Z

  • Anonymous
    December 06, 2010
    The comment has been removed

  • Anonymous
    June 10, 2014
    Can you tell me , Why we need local admin right for visual studio?