13

我有 Windows 8 我有一个用 c# 和 Visual Studio 2013 编写的 Windows 应用程序,并且想要安装这个应用程序。

我打开命令提示符写:

c:\..\instalutil.exe c:\projectfolder\filename.exe

在我运行此代码后,它给了我错误:

An exception occured during the Install phase.
System.InvalidOperationException: Cannot open Service Control Manager on computer '.'. This operation might require other privileges.
The inner exception System.ComponentModel.Win32Exception was thrown with the following error message: Access is denied.

这是我的电脑,我不知道为什么它需要访问权限?而且我不知道如何给予正确的特权。

我也将我的 sercviceProcessInstaller Account 属性更改为 LocalSystem 并尝试使用 LocalService 但它们都给了我同样的错误。

我应该怎么做才能给予正确的特权?

4

2 回答 2

29

我终于找到了答案:

解决方案:以管理员身份运行命令提示符

于 2014-07-09T09:23:03.257 回答
0

就我而言,我自己也遇到了这个问题,因为我无法以管理员身份从 .exe 文件显式运行“Visual Studio 开发人员命令提示符”,并使用“工具 => 外部工具”创建快捷方式以在 Visual Studio 中运行它. 为了解决这个问题,我尝试以管理员身份运行 Visual Studio,它运行良好。

似乎是 Visual Studio 程序不需要访问来执行操作。

于 2016-09-07T11:21:15.807 回答