为了账号安全,请及时绑定邮箱和手机立即绑定

如何使.NET Windows服务在安装后立即启动?

如何使.NET Windows服务在安装后立即启动?

红糖糍粑 2019-07-06 13:24:22
如何使.NET Windows服务在安装后立即启动?除了service.startType=ServiceStartMode.AutomaticMy服务安装后不会启动解在ProjectInstaller上插入此代码protected override void OnAfterInstall(System.Collections.IDictionary savedState){     base.OnAfterInstall(savedState);     using (var serviceController = new ServiceController(this.serviceInstaller1.ServiceName, Environment.MachineName))         serviceController.Start();}多亏了ScottTx和Francis B.
查看完整描述

3 回答

  • 3 回答
  • 0 关注
  • 724 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号