用c#写的windows服务时,将服务进行安装成功后,出现了了“启动服务时,提示“错误1053:服务没有及时相应启动或控制请求””的错误。
我出现上述情况是因为我将下面的启动代码给注释掉了。
ServiceBase[] ServicesToRun;
ServicesToRun = new ServiceBase[]
{
new JhglService()
};
ServiceBase.Run(ServicesToRun);