.net 默认情况下如何以管理员身份运行 Visual Studio?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/9654833/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How do I run Visual Studio as an administrator by default?
提问by Kumar
I recently discovered that even while logged into my personal laptop as an administrator, Visual Studio does not run in administrator mode and you need to explicitly use Run As Administrator.
我最近发现,即使以管理员身份登录到我的个人笔记本电脑,Visual Studio 也不会以管理员模式运行,您需要明确使用Run As Administrator。
Is there a way to make it run as an administrator by default, other than creating a shortcut, etc.?
除了创建快捷方式等,有没有办法让它默认以管理员身份运行?
回答by hamid reza mansouri
Copied and pasted from here, the Using Advanced Propertiessection. This will allow you to always have the program run as an administrator when you open it.
从这里复制并粘贴,使用高级属性部分。这将允许您在打开程序时始终以管理员身份运行该程序。
Windows 7:
Windows 7的:
- Right click on the shortcut of the program, then click on Properties.
- Click on the Shortcut tab for a program shortcut, then click on the Advanced button.
- Check the 'Run as administrator' box, and click on OK.
- Click on OK.
- Open the program.
- If prompted by UAC, then click on Yes to apply permission to allow the program to run with full permission as an Administrator.
- 右键单击程序的快捷方式,然后单击“属性”。
- 单击程序快捷方式的快捷方式选项卡,然后单击高级按钮。
- 选中“以管理员身份运行”框,然后单击“确定”。
- 单击确定。
- 打开程序。
- 如果 UAC 提示,则单击“是”以应用权限以允许程序以管理员身份以完全权限运行。
NOTE: If you are doing this is while logged in as standard user instead of an administrator, then you will need to provide the administrator's password before the program will run as administrator.
注意:如果您是在以标准用户而不是管理员身份登录时执行此操作,则您需要在程序以管理员身份运行之前提供管理员密码。
Update: (2015-07-05)
更新: (2015-07-05)
Windows 8, 8.1 and 10
Windows 8、8.1 和 10
In Windows 8, you have to right-click devenv.exe and select "Troubleshoot compatibility".
在 Windows 8 中,您必须右键单击 devenv.exe 并选择“兼容性疑难解答”。
Select "Troubleshoot program"
Check "The program requires additional permissions" click "Next", click "Test the program..."
Wait for the program to launch
Click "Next"
Select "Yes, save these settings for this program"
Click "Close"
选择“疑难解答程序”
勾选“程序需要附加权限”点击“下一步”,点击“测试程序...”
等待程序启动
点击下一步”
选择“是,为此程序保存这些设置”
点击“关闭”
Update reference original Link
更新参考原文链接
回答by Tshilidzi Mudau
Try the following steps on Windows 10:
在 Windows 10 上尝试以下步骤:
Search for Visual Studio on the Start window and select "Open file location":
Select "Troubleshoot compatibility" :
Select "troubleshoot program":
- Raise permissions:
Select "Yes, save these settings for this program"
Select "Close"
Once that is done, Visual Studio should be running as administrator.
完成后,Visual Studio 应该以管理员身份运行。
回答by Matan Shahar
Right click on the application, Props -> Compatibility -> Check the Run the program as administrator
右键单击应用程序,道具-> 兼容性-> 选中以管理员身份运行程序
回答by Nate
Applying this change will make it so that when you double click on a .slnfile Visual Studio will notopen. Also, you will not be able to drag and drop files into Visual Studio.
应用此更改将使当您双击.sln文件时 Visual Studio不会打开。此外,您将无法将文件拖放到 Visual Studio 中。
Follow the numbered instructions for each file in the bullited list. The paths are for a standard 64-bit install so you may have to adjust them for your system.
按照项目列表中每个文件的编号说明进行操作。这些路径适用于标准的 64 位安装,因此您可能需要为您的系统调整它们。
C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VSLauncher.exeC:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exeC:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exeC:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe- Right click on the file and select
Properties - Select the
Compatibilitytab - Optional: Select
Change settings for all users - Select
Run this program as an administrator - Select Ok and close the dialog
- Right click on the file and select
C:\Program Files (x86)\Common Files\microsoft shared\MSEnv\VSLauncher.exeC:\Program Files (x86)\Microsoft Visual Studio 9.0\Common7\IDE\devenv.exeC:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\devenv.exeC:\Program Files (x86)\Microsoft Visual Studio 11.0\Common7\IDE\devenv.exe- 右键单击文件并选择
Properties - 选择
Compatibility选项卡 - 可选:选择
Change settings for all users - 选择
Run this program as an administrator - 选择确定并关闭对话框
- 右键单击文件并选择
回答by Jsen Fruge
回答by Deblaton Jean-Philippe
windows 8
窗口 8
there is no advanced tab anymore. So, to do it automatically, you need to follow the next steps :
没有高级选项卡了。因此,要自动执行此操作,您需要执行以下步骤:
-right click on the shortcut
-click on properties
-under the "Shortcut" tab, click on "Open File Location"
-then, right click on devenv.exe
-Troubleshoot compatibility
-Troubleshoot program
-Check "The program requires additional permissions"
-Then next, next next,...
-右键单击快捷方式 -
单击属性
-在“快捷方式”选项卡下,单击“打开文件位置”
-然后,右键单击 devenv.exe
- 兼容性
疑难解答 - 程序疑难解答-
选中“程序需要其他权限”
-那么接下来,接下来,……
回答by Hadi Salehy
Follow these simple steps:
请按照以下简单步骤操作:
- Right Click on "devenv.exe"
- Click "Troubleshoot compatibility"
- Click "Troubleshoot program" Check "The program requires additional permissions"
- Click "Next"
- Click "Test the program...". It should launch Visual Studio as Administrator
- Click "Next"
- Click "Yes, save these settings for this program"
- Click "Close the troubleshooter"
- Now the Visual Studio will always run as Administrator.
- 右键单击“devenv.exe”
- 点击“兼容性疑难解答”
- 点击“程序疑难解答”勾选“程序需要额外权限”
- 点击下一步”
- 单击“测试程序...”。它应该以管理员身份启动 Visual Studio
- 点击下一步”
- 单击“是,为此程序保存这些设置”
- 点击“关闭疑难解答”
- 现在 Visual Studio 将始终以管理员身份运行。
回答by Efe ?ZYER
One time fix :
一次性修复:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers]
"C:\Program Files (x86)\Microsoft Visual Studio 14.0\Common7\IDE\devenv.exe"="~ RUNASADMIN"
回答by codingpirate
Right click on icon --> Properties --> Advanced --> Check checkbox run as Administrator and everytime it will open under Admin Mode (Same for Windows 8)
右键单击图标 --> 属性 --> 高级 --> 选中以管理员身份运行的复选框,每次它将在管理员模式下打开(Windows 8 相同)
回答by u1230329
Right-click the icon, then click Properties. In the properties window, go to the Compatibility tab. There should be a checkbox labeled "Run this program as an administrator." Check that, then click OK. The next time you run the application from that shortcut, it will automatically run as the admin.
右键单击该图标,然后单击“属性”。在属性窗口中,转到兼容性选项卡。应该有一个标记为“以管理员身份运行此程序”的复选框。检查,然后单击确定。下次从该快捷方式运行应用程序时,它将自动以管理员身份运行。


