【问题标题】:installing windows service error: cannot open service control manager on computer. this operation might require other privileges安装 Windows 服务错误:无法在计算机上打开服务控制管理器。此操作可能需要其他权限
【发布时间】:2014-08-30 05:42:27
【问题描述】:

我有 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 但它们都给了我同样的错误。

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

【问题讨论】:

    标签: windows-services installutil


    【解决方案1】:

    我终于找到了答案:

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

    【讨论】:

    • 嗨,我有同样的问题,我运行这个 commond :C:\Windows\Microsoft.NET\Framework\v4.0.30319\InstallUtil.exe E:\DataService\DataSrvice.exe 它工作正常。
    【解决方案2】:

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

    似乎是 Visual Studio 程序不需要访问权限即可执行操作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-05-31
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2013-04-09
      • 2011-02-12
      • 2014-07-18
      相关资源
      最近更新 更多