【问题标题】:Installed Microsoft Service with success, but doesn't see on service list已成功安装 Microsoft 服务,但未在服务列表中看到
【发布时间】:2018-06-04 09:59:01
【问题描述】:

我需要帮助。 我按照这个tutorial 安装了微软服务,成功了,但是在服务列表中看不到。

我的服务:

public partial class Service1 : ServiceBase
{
    public Service1()
    {
        InitializeComponent();
    }

    protected override void OnStart(string[] args)
    {

    }

    protected override void OnStop()
    {

    }
}

还有其他安装服务的模式吗?还是我错了?

我对开发者命令工具的回应:

开始安装的安装阶段。查看日志文件的内容 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 大会的进展。该文件位于 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.InstallLog。 安装组件 'C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe'。 受影响的参数是:logtoconsole = assemblypath = C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 日志文件 = C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.InstallLog 没有具有 RunInstallerAttribute.Yes 属性的公共安装程序 可以在 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 组装。

安装阶段成功完成,提交阶段是 开始。查看日志文件的内容 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 大会的进展。该文件位于 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.InstallLog。 提交组装 'C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe'。 受影响的参数是:logtoconsole = assemblypath = C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 日志文件 = C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.InstallLog 没有具有 RunInstallerAttribute.Yes 属性的公共安装程序 可以在 C:\projects\SimPortalService\SimPortalService\bin\Debug\SimPortalService.exe 部件。删除 InstallState 文件,因为没有安装程序。

提交阶段成功完成。

事务安装已完成。

【问题讨论】:

  • 你怎么知道安装成功了?
  • 你刷新服务列表了吗?
  • @CodeCaster 是的..我已经刷新了

标签: c# service installutil


【解决方案1】:

您跳过了文章中的一个重要步骤:

为了使用本文中的步骤,您首先需要将服务安装程序添加到您的 Windows 服务中。见Walkthrough: Creating a Windows Service Application in the Component Designer

您的服务没有安装程序,因此installutil 报告说没有工作要做:

找不到具有 RunInstallerAttribute.Yes 属性的公共安装程序

所以,为您的服务创建一个安装程序。

【讨论】:

  • 我已经添加了广告安装程序,但是如何在同一个解决方案中将服务与安装程序连接起来?
猜你喜欢
  • 2012-09-03
  • 2014-09-29
  • 1970-01-01
  • 1970-01-01
  • 2010-12-06
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多