Sometimes you may need to run Visual Studio as Administrator; to do so, you have to right-click on Visual Studio task bar shortcut, right-click again on Visual Studio and select Run as Administrator. Then, you may open the solution you want manually from File -> Open -> Project/Solution or drop your .sln file onto Visual Studio.
To make your life easier, you may perform the following tasks in order to start as Administrator faster.
Open Visual Studio as Administrator
If you want to start Visual Studio as Administrator you can do the following:
- right-click on your VS task bar shortcut
- right-click on your VS product and select Properties
- from Properties window select Advanced…
- from Advanced Properties check on Run as Administrator option
- select Ok in Advanced Properties window, Apply and then Ok on VS 2017 Properties
Open every Visual Studio Solution (.sln) as Administrator
Although not the best idea if you open third-party VS solutions, it may come in handy if you need to open the same solutions as Administrator again and again. To do so, right-click on devenv.exe and select Troubleshoot Compatibility.
You may then proceed to the following steps:
- on the Program Compatibility Troubleshooter window, click on Troubleshoot Program
- check 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
Following the above, whenever you open a solution (.sln) it will always open as Adminsitrator. If you want to disable this function, you will need to follow again the steps above without checking though The Program requires additional permissions.