Running Visual Studio as Administrator

Home » General Topics » Running Visual Studio as Administrator
Photograph of engineers tools

I have user account control turned off on my development machine and also run Visual Studio as administrator by having the shortcut on my task bar, right clicking, right clicking Visual Studio choosing properties and then clicking Advanced on the Shortcut tab.

However, in Windows 10/Visual Studio 2015, I have discovered the problem when developing a web project in IIS where if you are not in administrator mode, you will get “Unable to start debugging on the web server. IIS does not list a web site that matches the launched URL.”.

Unable to start debugging on the web server. IIS does not list a web site that matches the launched URL.

Running Visual Studio as administrator fixes this problem. But the problem with my method of setting the shortcut above means that if you right click the shortcut, and then click a recent project, Visual Studio does not run in administrator! Talk about life being complicated enough without some butt head at Microsoft making it even more complicated! Not only that, the error message is a lie, it should just say “You don’t have permission to access IIS, do you want me to fix this?”!!

I learnt something today, which is why I’m writing this post. The way to fix it every time you run Visual Studio, is to update devenv.exe in the Visual Studio folder to always run in administrator mode.

To do this, carry out the following steps:

1. Find Visual Studio. Mine was in c:\program files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe. I found this from the right click menu on the short cut where I clicked “Open File Location”, which was easier than browsing the file explorer for it.

Shortcut Properties showing advanced button

2. Right click devenv.exe in file explorer and click “Troubleshoot Compatibility”. The first time I ran this it took me straight to the test page in the wizard for some reason so I ran it again.

Program Compatibility Troubleshooter

3. Click “Troubleshoot Program” then “The program requires additional permissions” and click next.

Program Compatibility Troubleshooter

4. You have to click “Test the program” otherwise you cannot continue. After doing this click Next. You then have the option to save the settings.

Program Compatibility Troubleshooter

5. Click the “Yes, save these settings for this program” and you are done.

About Phil

I have been working as a software developer since 1983. This blog could have been called “From Fortran 77, C and Cobol to C# in 20 (not so) easy years”, but it doesn’t sound quite right somehow. Besides I’m talking about what’s happened since 2003, not before!

One Response to “Running Visual Studio as Administrator”
  • Ganesh

    This blog really helped me in resolving the issue. Followed the same steps and it resolved the issue. I have been researching for answer in google and tried so many solution nothing fixed but this one did. Thanks a tone.

    Reply

Leave a Reply

Your email address will not be published.


You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code class="" title="" data-url=""> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong> <pre class="" title="" data-url=""> <span class="" title="" data-url="">




Top Posts & Pages

Categories

Recent Posts

Recent Comments

Archives

Blogroll

  • Mike Cohn's Blog
  • Scott Hanselman's Blog
- mike@mountaingoatsoftware.com

Scrum teams have too many meetings is perhaps the most common criticism of Scrum. But is it valid? [...]

- mike@mountaingoatsoftware.com

Here are five key lessons I learned that were instrumental in my career. See if learning them could [...]

- mike@mountaingoatsoftware.com

A team’s sprints should be the same length every sprint. Here are four reasons why. [...]

- mike@mountaingoatsoftware.com

Read this special Halloween post about five things in agile transitions that are can seem as scary a [...]

- mike@mountaingoatsoftware.com

If you want to overcome problems and improve how you work with user stories, register now through Oc [...]

- Scott Hanselman

In 2016 and 2015 I made a list of best Christmas STEM Toys for kids! If I may say so, they are still [...]

- Scott Hanselman

I'm glad you have a 1080p 60fps accelerated graphics setup, but I'm old school. Impress me [...]

- Scott Hanselman

Visual Studio Code has a HUGE extension library. There's also almost two dozen very nice Azure [...]

- Scott Hanselman

I got an email this week asking how to download some of my Azure Friday video podcast videos from ht [...]

- Scott Hanselman

There's a couple of great utilities that have come out in the last few weeks in the .NET Core w [...]

Meta