Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make Visual Studio 2019 Always Run as Administrator from Start Bar Recent Solutions List

I recently upgraded to Windows 10 and Visual Studio 2019.

Prior to the upgrade, Visual Studio 2017 would always run as Administrator. I did not think much of this, but now that it is gone it is causing me problems.

The primary one is that it will not load my projects that use my local instance of IIS.

I usually launch Visual Studio from my start bar. Right now this goes like this:

  1. Right click on the icon on the start bar and select my solution.
  2. It loads and then I realize that the main project did not load.
  3. Close visual studio, open as admin
  4. Pick my solution and then it loads.

I would really like to only have to do #1 above. Is there someway I can edit the shortcut on the start bar to have it always launch as Administrator?

like image 810
Vaccano Avatar asked Aug 28 '19 18:08

Vaccano


People also ask

How do I make Visual Studio always open as an administrator?

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.

Do I need to run Visual Studio as administrator?

You can do nearly everything in the Visual Studio IDE as a normal user, but, you need administrator permissions to complete the following tasks: Installing Visual Studio. Upgrading from a trial edition of Visual Studio. Installing, updating, or removing local Help content.

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".

How do I open Visual Studio in non admin mode?

Right click on the Visual Studio icon. Choose Properties. Select the Compatibility tab. Unchecked Run this program as an administrator inside the Privilege Level group box.


1 Answers

Turns out that Visual Studio uses different permissions when you click on the list of shortcut options it offers in the start menu. (IE to load a recent solution directly.)

Selecting the Properties->Advanced->"Run as Administrator" did not cause these to run as administrator.

But this did it:

  • Find devenv.exe (Visual Studio's executable)
  • Right Click on it and select "Troubleshoot Compatibility".
  • On the Program Compatibility Troubleshooter window, click on Troubleshoot Program
  • Check that the program requires additional permissions and click Next
  • On the next window, click on Test the program… and VS will open as administrator
  • Click next and then click on Yes, save these settings for this program

Now Visual Studio will ALWAYS run as administrator.

(Taken from: https://ppolyzos.com/2017/08/08/always-run-visual-studio-as-administrator/)

like image 52
Vaccano Avatar answered Nov 03 '22 06:11

Vaccano