安装windows服务,报错

来源:互联网 发布:myeclipse配置优化 编辑:程序博客网 时间:2024/06/05 14:36

安装时发现如下异常

System.InvalidOperationException: Installation failed due to the absence of a ServiceProcessInstaller.The ServiceProcessInstaller must either be the containing installer, or it must be present in the Installers

 

报这个错的原因是

 this.Installers.AddRange(new System.Configuration.Install.Installer[] {
            this.serviceInstaller1
            ,this.serviceProcessInstaller1});

 

在这里没有,this.serviceProcessInstaller1,

 

手动加上即可