继承windows service的安装类出现的多余服务被安装的问题
2010-10-12 10:07
519 查看
最近开发了两个windows service的程序,由于有共同之处,因此我在第二个service的安装类中直接继承了第一个service的安装类。 结果发现用installutil工具对第二个service进行安装的时候,有多余的service被安装上去。
ProjectInStaller 是继承了System.Configuration.Install.Installer. 它们在构造函数里面有一个InitializeComponent函数,而在这个函数里面他们加载了SerivceInstaller,因此,如果第二service继承了第一个service,它就有两个ServiceInstall,因此会安装一个多余的service。解决方法很简单:在子类中的构造函数里面去掉InitializeComponent 就可以了。
ProjectInStaller 是继承了System.Configuration.Install.Installer. 它们在构造函数里面有一个InitializeComponent函数,而在这个函数里面他们加载了SerivceInstaller,因此,如果第二service继承了第一个service,它就有两个ServiceInstall,因此会安装一个多余的service。解决方法很简单:在子类中的构造函数里面去掉InitializeComponent 就可以了。
相关文章推荐
- 出现“无法通过windows installer服务安装此安装程序包。您必须安装带有更新版本Windows Installer服务的Windows Service Pack”提示如何解决?
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误
- 解决Windows安装解压版MySQL出现服务正在启动-服务无法启动的问题
- 解决Windows安装解压版MySQL出现服务正在启动-服务无法启动的问题
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误 [转]
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误
- 解决Windows安装解压版MySQL出现服务正在启动-服务无法启动的问题
- 解决Windows安装解压版MySQL出现服务正在启动-服务无法启动的问题
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误
- 解决Windows安装解压版MySQL出现服务正在启动-服务无法启动的问题
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."
- windows安装Apache,注册服务出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."错误
- Windows 7安装QQ2010出现Windows Installer服务问题无法安装
- Cannot create windows service for mysql.error:0 (解决安装MYSQL5出现问题)
- 解决Windows安装解压版MySQL出现服务正在启动-服务无法启动的问题
- windows 2003中安装net Framework 2.0 后Reporting Service 出现问题及其解决方法
- windows安装Apache,注册服务时出现“(OS 5)拒绝访问。 : AH00369: Failed to open the WinNT service manager..."
- MongoDB安装到windows服务的方法及遇到问题的完美解决方案