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.
Thanks for saving me a lot of time.
Perfect
Thank you. 🙂
Tahnk you PPOLYZOS.
Thank you very much – strightforward and concise.
Thank You
Thanks a lot it was helpful
Thanks
Perfect, saved lot of my time!
Awesome!
Awesome! Thanks!
Thanks
Thank you sir.!
thanks a lot
Very helpful, thank you for sharing!
Working with Visual Studios 2017 and Windows 10 Enterprise (1903) 64 bit this has issues for me. It still works but has an annoyance that you always need to deal with.
When loading a solution (*.sln) I get a prompt to “Save changes to the following items?”. The items below is a single item called “devenv.sln”. If you always click NO like I did (because I didn’t want to alter my project or save some bogus solution to a random area on my drive) then you will ALWAYS see this prompt and it will continue to load your solution.
However, if you click yes and let it save the new solution to it’s default location (C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\IDE\devenv.sln in my case) it will never prompt you again.
My guess is the way it’s loading the application with elevated privileges is kinda weird and it tries to load the application with a new default solution. Then it tries to open your solution up and in the process is trying to close an unsaved solution for which then it prompts you to save. No matter what the reason is, if you save the solution once it wont bother you again.
Thanks
thanks, Very helpful