Make visual studio solution files(sln) always executed as administrator

Locate the devenv.exe executable on your hard drive. You can usually find it in the following places:

Visual Studio 2013
C:\Program Files (x86)\Microsoft Visual Studio 12.0\Common7\IDE\devenv.exe

Visual Studio 2015
C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe

Visual Studio 2017
C:\Program Files (x86)\Microsoft Visual Studio\2017\<SKU_TYPE>\Common7\IDE\devenv.exe

Right click on the devenv.exe executable in Windows Explorer and select "Troubleshoot compatibility" and then select "Troubleshoot program." From the next screen select "The program requires additional permissions" and then complete the wizard.

This will change your settings so that any time you try to run Visual Studio you will be running elevated.


StackExchange has already answered this and is more comprehensive, covering Windows 7, 8, 10 as well as modifying jump lists. In general most people won't want to always run as admin, so permanently modifying the devenv.exe doesn't seem like a good general solution: https://stackoverflow.com/questions/9654833/how-to-run-visual-studio-as-administrator-by-default


In Windows 10 do the following steps: - Download and install the 'Everything' application that locates files and folders by name instantly. - Find the 'devenv.exe' and locate it.

Everything

  • Right-click on 'devenv.exe' and select "Troubleshoot compatibility". Then select "Troubleshoot program". Then check "The program requires additional permissions". Then test the setting and save setting in next page.

Troubleshoot compatibility

Troubleshoot program

The program requires additional permissions

Run As admin