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.”.
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.
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.
3. Click “Troubleshoot Program” then “The program requires additional permissions” and click next.
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.
5. Click the “Yes, save these settings for this program” and you are done.