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

如何使.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 关注
  • 666 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信