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"

文章来自:http://www.cnblogs.com/xdot/p/6259876.html
© 2021 jiaocheng.bubufx.com  联系我们
ICP备案:鲁ICP备09046678号-3