日期:2014-05-17  浏览次数:20726 次

无法启动多个Windows服务,只能启动ServiceBase数组中第一个服务
static class Program
{
/// <summary>
/// 应用程序的主入口点。
/// </summary>
static void Main()
{
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new Service1(),
new Service2(),
};
ServiceBase.Run(ServicesToRun);
}
}


每次都只能启动ServiceBase数组中第一个服务(Service1)。
Windows服务 ServiceBase

------解决方案--------------------
另起一个服务名称
------解决方案--------------------
检查下new Service1(),new Service2(),的name是不是一样的。。。。。。。