Isabella
---- I fell upon the thorn of life, I bleed.

当我们的服务依赖其他的服务才能启动时,我们需要给它添加依存关系。

在你的serviceInstaller上点右键,选择属性, 设置ServicesDependedOn.

当然你也可以在ProjectInstaller 的InitializeComponent方法里添加代码,例子如下:

this.serviceInstaller1.ServicesDependedOn = new string[] { "Eventlog", "WinMgmt","MMQ","Windows Management Instrumentation" }; 

posted on 2012-01-12 14:08  李昀璟  阅读(480)  评论(0编辑  收藏  举报