zoukankan      html  css  js  c++  java
  • C#编写windows服务,多服务为什么只启动一个(ServiceBase.Run)

    https://zhidao.baidu.com/question/380395667.html

    //多服务一个宿主程序时必须注间以下要点: 

     Service1的ServiceName 必须 Installer1.Designer.cs 中的 serviceInstaller1.ServiceName 完全一致

    //this.ServiceName MUST match this.serviceInstaller1.ServiceName in Installer1.Designer.cs file 

    //this.ServiceName MUST match this.serviceInstaller2.ServiceName in Installer1.Designer.cs file

    //this.ServiceName MUST match this.serviceInstaller3.ServiceName in Installer1.Designer.cs file

    //serviceInstaller1中的代码

    //this.serviceInstaller1.ServiceName = "Win32MultiServices1"; 

    //Service1中的代码

    //this.ServiceName = "Win32MultiServices1"

    2.ServiceName已经一样 还是只能启动一个

    代码对比,少了一个Installer,不是主要原因

      this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceProcessInstaller1,
                this.serviceInstaller1});
    this.Installers.AddRange(new System.Configuration.Install.Installer[] {
                this.serviceProcessInstaller1,
                this.serviceInstaller1,
                this.serviceInstaller2});

    1.改变显示名称,描述

    2.删除所有Installer重新添加

  • 相关阅读:
    平板涂色
    速算游戏_NOI导刊2011提高(04)
    信息学奥赛一本通——配套刷题网站
    求10000以内n的阶乘
    大整数的因子
    计算2的N次方
    大整数加法
    带余除法
    A/B 高精度
    A*B 高静度
  • 原文地址:https://www.cnblogs.com/xdot/p/6259876.html
Copyright © 2011-2022 走看看