C#编写windows服务,多服务为什么只启动一个(ServiceBase.Run)

时间:2023-03-09 17:04:38
C#编写windows服务,多服务为什么只启动一个(ServiceBase.Run)

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

C#编写windows服务,多服务为什么只启动一个(ServiceBase.Run)

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

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"