Visual Studio requires elevated permissions in Windows 7
Asked Answered
G

8

17

I'm running Visual Studio 2008 on Windows 7. When I try to attach to a process, VS tells me to restart under different credentials (with elevated permissions).

So I have to restart VS and run it as Administrator. Is there a way to set it up so VS always starts with Admin privileges?

alt text

Godless answered 30/4, 2010 at 14:18 Comment(0)
S
19

shortcut Properties -> Compatibility tab -> set Run this program as an administrator checkmark.

[run as administrator]

Shaji in comments posted How to Run a Program as an Administrator in Windows 7 article link.

Most useful(as for me) is to use keyboard shortcut CTRL+Shift while opening the program.

Shannon answered 30/4, 2010 at 14:20 Comment(2)
Here is a nice tutorial on how this can be done in multiple ways sevenforums.com/tutorials/11841-run-administrator.htmlPetrology
Doing this will cause Windows to be unable to pass a file to Visual Studio - so for example if you "open" a .cs file from Windows Explorer, that action will fail with the "there was a problem sending the command to the program" error.Transfix
T
4

Personally (and I don't want to start a religious war on either side here), on any development rig, I always disable UAC. Then, on your test machine, ensure UAC is on and test as normal.

During development, there are an awful lot of tasks which require admin rights, so it's generally easier to just disable UAC.

Taverner answered 30/4, 2010 at 14:26 Comment(2)
sevenforums.com/tutorials/…Godless
See also #452309Gualtiero
F
1

If you always run Visual Studio as an administrator you are going to get the User Access Control warning every time you start it, even if you are logged in as an administrator to Windows. Obviously you can just click ‘OK’ to dismiss this warning, but it may tempt you to turn User Access Control off.

Note that this is true only if Vista’s User Account Control (UAC) is turned on. Many developers turn UAC off, and in this case Vista behaves in the same way as earlier versions of Windows with regard to starting Visual Studio: if you are logged in as an administrator then Visual Studio will by default run with administrative privileges.

The Administrator Account

Vista also has an account called ‘Administrator’ which behaves differently from other administrator accounts. In fact it behaves like administrator accounts in earlier versions of Windows, in that all programs launched when using it run with administrator privileges by default. There’s no need to specifically set up the program as described above.

As a developer your really shouldn’t need to use this account: you can develop with administrator privileges using the techniques described in this article.

However you may have occasions when you aren’t sure whether a program is failing because of some coding error or simply because a process is being launched with insufficient privileges. In these cases it may be useful to use the Administrator account temporarily to simply rule out a problem with privileges. Note that if you work for a large organization they are almost certainly not going to let you near this account, however: this is really only useful for those developing at home.

Using the Administrator Account

To enable the Administrator account start a command prompt with administrator privileges as described above (type ‘cmd’ in the Start Search box and hit Control-Shift-Enter). Then enter:

net user Administrator /active:yes

This has a blank password by default. To set a password use:

net user Administrator {password}

You can now log off and log on as the Administrator. Once you are done with any testing you should disable this account again as below

net user Administrator /active:no

Note that disabling the account does not clear the password. However if you forget it you can always set it again as above when you come to use the account again (provided you have access to at least one account with administrator privileges).

Hope this helps...

s

Fairish answered 30/4, 2010 at 20:19 Comment(0)
A
1

This error occurs because of The current user didn’t have a sufficient privilege to open Visual Studio.

To overcome this issue by right-clicking on visual studio and select run as administrator at every time you intend to open it

Also, you can check the compatibility troubleshooting

  • Right Click on Visual Studio > Select Troubleshoot compatibility.
  • Select Troubleshoot Program.
  • Check The program requires additional permissions.
  • Click on Test the program.
  • Wait for a moment till the program launch.Click Next.
  • Select Yes, save these settings for this program.
  • Wait for resolving the issue.
  • Make sure the final status is fixed.Click Close.

To find the detail steps for How to apply that check this link

https://blog.devoworx.net/2016/01/06/this-task-requires-the-application-to-have-elevated-permissions/

Hope it helps you

Amphipod answered 8/7, 2016 at 20:55 Comment(1)
In windows 10, not have any option like: Properties -> Compatibility tab -> Run this program as an administrator. So, your answer will helpful, least at for me.Nik
M
1

In my case the root of this issue was app.manifest file. You can try to remove it along with all its references or you can also left it in a project and tune it appropriately.

Mutant answered 17/9, 2019 at 10:24 Comment(0)
H
0

You only need to elevate VS when you are attaching to an elevated process. Not in general. Always launching VS with elevated permissions sounds like a real drag to me. YMMV I guess.

Heritage answered 30/4, 2010 at 20:34 Comment(0)
B
0

Right click on the project -> Properties -> Debug, then change Launch to IIS Express, after that a new options should appear below finally check Enable SSL box, save and that is it.

Beals answered 12/6, 2019 at 7:34 Comment(0)
G
0

Following on from @John Wales answer I had this in my app.manifest file:

<requestedExecutionLevel level="requireAdministrator" uiAccess="false" />

I commented it out and that cleared it for me. Note that whatever it was that required elevated level in the first place will surely no longer work! In my case that wasn't a problem.

Galengalena answered 2/2 at 16:15 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.