1

First of all I know how to set properties on devenv.exe so that VS opens by default with administrator privileges. My question is how to set priviledges on VS Solution/Project.

I have a VS project (not made by me), which on opening gives following message.

enter image description here

So I have to open VS with Administrator Privileges and then this project opens fine. But how do you set such condition in VS solution/Project?

Nikhil Agrawal
  • 47,018
  • 22
  • 121
  • 208

2 Answers2

1

You can set Privilege Level to Run this program as an administrator in windows for the devenv.exe. For this you have to take properties of devenv.exe by right clicking it and selecting properties. From properties window go to compatibility tab and then select the Run this program as an administrator checkbox. Please see the attached screen shot

enter image description here

Adil
  • 146,340
  • 25
  • 209
  • 204
  • But this condition is related to Project/Solution. I have other projects which do not have such condition. So I deducted that this is related to Project/Solution settings. – Nikhil Agrawal Jul 04 '16 at 04:42
  • 1
    If you do not run VS as administrator you will have privilege issues like file creation etc, for these condition you wont event get this warning but you would face privilege issue. So its generally good idea to apply it on VS devenv.exe and I see no harm in it. – Adil Jul 04 '16 at 04:46
  • 1
    @NikhilAgrawal, Adil is correct. For example I run into this if I open a solution with an IIS project, however it does not complain about the class library project or console app in the same solution. –  Jul 04 '16 at 04:51
  • 1
    @NikhilAgrawal read the error message. The problem is with the project directory permissions. – Blorgbeard Jul 04 '16 at 06:26
1

Right click on Visual Studio select properties, choose compatiblility tab and in Privilege Level select checkbox "Run this program as an administrator"

Next time if you open any project that will be open in administrator privilege.