Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual studio 2010 Requires Run as Admin to build website

I am using Visual Studio 2010 ultimate and have a solution that contains a website project. Under XP Pro evrything built fine. I moved over to a new machine running Windows 7 Ultimate, and now when I go to build the website I get the following error meesage:

------ Build started: Project: C:...\WebSite\, Configuration: Debug Any CPU ------ Validating Web Site : Build (web): Failed to map the path '/'

If I pick the "Run As Administrator" option for launching Visual Studio then the website builds perfectly and I have no errors ata all.

I would prefer to not have to constantly run Visual Studio as administrator. Any suggestions?

like image 410
RB Davidson Avatar asked Oct 07 '10 14:10

RB Davidson


People also ask

Why do I have to run Visual Studio as administrator?

Without Administrative permissions Visual Studio is not able to write to the hard drive outside of your specific user account privileges. This severely limits what can be done to build custom ArcGIS based applications.

Can you run Visual Studio without admin rights?

Welcome to Microsoft Q&A! For reasons of security, the administrator permissions are required when installing Visual Studio. According to your description, you can try to create a network installation and deploy to client workstations.

How do I give administrator permission in Visual Studio?

On the Windows desktop, right-click the Visual Studio shortcut, and then select Properties. Select the Advanced button, and then select the Run as administrator check box. Select OK, and then select OK again.

How do I stop Visual Studio from running as administrator?

You right-click the .exe file, go to properties, then click on the "shortcut" tab and click on "advanced" - then uncheck "run as administrator".


2 Answers

You can right have Visual Studio permanently running as an Administrator.

Simply follow these steps:

   1) Find the Visual Studio Executable.

    Visual Studio 2010 C# Express:
    C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\VCSExpress.exe

    Visual Studio 2010 Professional:
    C:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exe

    2) Right-click on the Visual Studio Executable and left-click Properties

    3) On the new window, click the Compatibility tab

    4) Tick the option "Run this program as an administrator"

    5) Click OK to save the settings

Enjoy Visual Studio without having to "Run as Administrator" each time. ;)

like image 102
eandersson Avatar answered Nov 15 '22 11:11

eandersson


You have two options in this case.

  1. You can setup VS to automatically run as administrator
  2. You can modify your web project to NOT be hosted in IIS, but rather to be hosted in the Visual Studio server. This is done via Project Properties under the "Web" tab, down towards the bottom.

Personally I run as Admin all the time.

like image 34
Mitchel Sellers Avatar answered Nov 15 '22 12:11

Mitchel Sellers