How to run recent project or solution as administrator on visual studio

You need to add string value to HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\ with name of full path to devenv.exe and value RUNASADMIN.

For my system path was: C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe.

And this: C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe for solve this problem.

You can do it in regedit or use console command (run with admin right's):

for Visual Studio IDE

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe" /t REG_SZ /d RUNASADMIN

for Visual Studio Version Selector ( Recomment by TooN DinDarkDevil )

REG ADD "HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" /v "C:\Program Files (x86)\Common Files\Microsoft Shared\MSEnv\VSLauncher.exe" /t REG_SZ /d RUNASADMIN

Here how it should look in registry editor after key adding: regedit windows after key adding

After that all projects will be open with admin rights.

It worked for me on Window 8.1 Pro 64-bit | Visual Studio Enterprise 2015

Additional information. TooN DinDarkDevil

"Microsoft Visual Studio Version Selector" when your window have installed multi version of "Visual Studio" .Visual Studio Project&Solution default openning is "Visual Studio Version Selector".

This work for me now (include recent shortcut) .

enter image description here

result..

  1. Open by pin of "Visual Studio 2015" ( work ) enter image description here


2. Open by recent of "Visual Studio 2015" ( work ) enter image description here


3. Open by pin of "Visual Studio Version Selector" ( work ) enter image description here


4. Open by recent of "Visual Studio Version Selector" ( work ) enter image description here


P.S. try it your self !!


I ran the troubleshoot compatibility option.

Step 1: Go to C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE. Right click on devenv.exe and select "Troubleshoot compatibility"
Step 2: Select "This program requires additional permissions"
Step 3: Test and click on next.

Everything will be working smoothly now.

Note: Don't forget to save the settings.

enter image description here