WCF服务 自动启动设置代码
View Code
1 public ProjectInstaller() 2 { 3 InitializeComponent(); 4 this.Committed += new InstallEventHandler(ProjectInstaller_Committed); 5 } 6 7 private void ProjectInstaller_Committed(object sender, InstallEventArgs e) 8 { 9 System.ServiceProcess.ServiceController controller = new System.ServiceProcess.ServiceController("VAV_SERVICE"); 10 controller.Start(); 11 }