除了服务.StartType=ServiceStartMode.自动"我的服务"在安装后不会启动
Solution个
在我的ProjectInstaller上插入了此代码
protected override void OnAfterInstall(System.Collections.IDictionary savedState)
{
base.OnAfterInstall(savedState);
using (var serviceController = new ServiceController(this.serviceInstaller1.ServiceName, Environment.MachineName))
serviceController.Start();
}
多亏了Scottx和Francis B.