在Visual Studio中添加服务安装程序和服务流程安装程序 [英] Adding a service installer and service process installer in visual studio

查看:112
本文介绍了在Visual Studio中添加服务安装程序和服务流程安装程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

由于某种原因,在将Installer类添加到Windows Service项目之后,我以设计模式打开它并单击鼠标右键,但是没有选择添加服务安装程序或服务进程安装程序的选项.有谁知道为什么会这样?

For some reason, after adding a Installer class to my Windows Service project, I open it up in design mode and right click, but there is no option to add either a service installer or a service process installer. Does anyone know why this may be the case?

推荐答案

在Visual Studio 2008和2010中,最好的方法是在设计模式下打开ServiceBase组件(默认命名为Service1). .然后,右键单击设计器,然后选择添加安装程序选项.这将添加ProjectInstaller组件以及必要的程序集引用.反过来,ProjectInstaller组件具有自动添加的服务安装程序和服务流程安装程序.

In both Visual Studio 2008 and 2010, the best way to do this is to open the ServiceBase component (named Service1 by default) in design mode. Then, right-click in the designer and select the Add Installer option. This adds a ProjectInstaller component along with the necessary assembly references. The ProjectInstaller component, in turn, has the service installer and service process installer added automatically.

在没有其他细节的情况下,我最好的猜测是您在项目中手动添加了一个组件/类并将其命名为Installer,而不是让Visual Studio为您完成工作.

Without additional detail, my best guess is that you manually added a component/class to your project and named it Installer instead of letting Visual Studio do the work for you.

请参阅我的帖子此处有关如何操作的信息在Visual Studio 2008中创建基本服务(似乎也可以在2010年工作).请特别注意步骤6.

See my post here for how to create a basic service in Visual Studio 2008 (seems to work in 2010 as well). Pay particular attention to Step 6.

希望这会有所帮助.

这篇关于在Visual Studio中添加服务安装程序和服务流程安装程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆