【问题标题】:InstallUtil throwing exception when trying to install windows service on Windows 2012 server尝试在 Windows 2012 服务器上安装 Windows 服务时,InstallUtil 抛出异常
【发布时间】:2014-03-18 14:07:17
【问题描述】:

我使用 VS 2010(32 位)开发了一个 Windows 服务,但为“任何 CPU”编译它。

我已将所需的 exe 和其他文件传输到 Windows 2012 Server(标准版 - 64 位),现在尝试使用 InstallUtil 安装它

我已将命令提示符上的路径更改为“C:\Windows\Microsoft.NET\Framework64\v4.0.30319”,然后运行命令

InstallUtil "D:\MyPath\MyService.exe"

但安装失败并出现错误

    An exception occurred during the Install phase.
    System.Security.SecurityException: The source was not found, 
but some or all event logs could not be searched.  
Inaccessible logs: Security.

我尝试以管理员身份运行InstallUtil。服务器没有 Visual Studio 命令提示符。

我该如何解决这个问题?

【问题讨论】:

    标签: installutil


    【解决方案1】:

    我认为它应该带有扩展名 (.exe) 并且不带引号。它是:

    InstallUtil.exe D:\MyPath\MyService.exe
    

    如果您在“Windows PowerShell”中,则应添加“/.”。它是:

    ./InstallUtil.exe C:\ServicesExample\Services.MyService.exe
    

    一旦您打开:C:\Windows\Microsoft.NET\Framework\v4.0.30319 并以管理员身份运行。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2018-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多