Visual Studio extension to run Visual Studio as administrator
- Install the RunAsAdmin extension
- Go to Tools -> Options -> RunAsAdmin
- Set Enabled to true
- Restart Visual Studio
- Go to Tools -> Options -> RunAsAdmin
- Set Enabled to false
- Restart Visual Studio
When uninstalling the extension the current elevation mode will be preserved. If you have the extension Enabled in the options and uninstall it, Visual Studio will remain running as administrator. You have to use the RunAsAdmin options setting to enable or disable.
When disabling the extension from within the Visual Studio extensions dialog nothing will happen like with uninstalling the extension. You have to use the RunAsAdmin options setting to enable or disable.
The extension adds two registry entries at the following location: HKEY_CURRENT_USER\Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers\
One for the path to Visual Studio and one for the path to the Visual Studio Launcher. The value of the registry entries will be "RUNASADMIN" or "RUNASNORMAL"
Cazzulino - How to get Visual Studio 2017 installation path
Rick van den Bosch - Running Visual Studio as an administrator causes ‘Save changes to devenv.sln’ when double clicking solutions