Adding a service installer and service process installer in visual studio

梦想的初衷 提交于 2019-12-03 09:04:10

问题


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?


回答1:


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.

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.

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.

Hope this helps.



来源:https://stackoverflow.com/questions/6460686/adding-a-service-installer-and-service-process-installer-in-visual-studio

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!