问题构建Windows服务的安装项目 [英] Problem building Setup project for Windows Service

查看:121
本文介绍了问题构建Windows服务的安装项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

使用VS 2005:

我有一个Windows服务项目。我在该项目中有一个ServiceInstaller类来安装该服务。

我还为该服务创建了一个Setup项目。在"自定义操作"下,我已添加到"安装"文件夹"MyService(Active)的主要输出"中。和Uninstall文件夹相同。
当我尝试构建设置时,我收到错误:
无法从MyService(Active)构建名为Primary output的自定义操作,InstallerClass属性仅对程序集有效。 >
我是否必须将安装程序类放在单独的项目中?我认为这不是InstallerClasses的要求。我认为它们也可能在您的可执行文件中。

Using VS 2005:

I have a project which is a Windows Service. I have a ServiceInstaller class in that project which installs the service.

I have also created a Setup project for the service. Under Custom Actions, I've added to the Install folder "Primary output from MyService (Active)" and the same to the Uninstall folder.
When I try to build the setup I get the error:
Unable to build custom action named Primary output from MyService (Active), InstallerClass property is only valid for assemblies.

I do I have to put the installer class in a separate project? I didn't think that this was a requirement for InstallerClasses. I thought that they could also be in your executable.

推荐答案

您好

我不确定出了什么问题,但这里有一些我觉得有用的链接:

I'm not sure what's wrong but here's some links I found useful:

好文章

http:/ /www.codeproject.com/vb/net/WindowsServiceInstall.asp

http://www.codeproject.com/vb/net/WindowsServiceInstall.asp

创建Windows服务

Creating a Windows Service

http://msdn.microsoft.com/ library / default.asp?url = / library / en-us / vbcon / html / vbwlkwalkthroughcreatingwindowsserviceapplication.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon/html/vbwlkwalkthroughcreatingwindowsserviceapplication.asp

设置项目

http:// msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vbconSetupProjects.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vbconSetupProjects.asp

自定义操作

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxwlkWalkthroughCreatingCustomAction.asp

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vsintro7/html/vxwlkWalkthroughCreatingCustomAction.asp

回答问题:不,安装程序类与Windows服务位于同一项目中。

To Answer the question: No, the Installer Class goes in the same project as the Windows Service.

我按照这些操作在VS2003中创建了我的第一个Windows服务和安装项目,现在已迁移到VS2005。希望他们为你工作。

I followed these to create my first Windows Service and Setup Projects back in VS2003 and have now migrated to VS2005. Hope they work for you.

问候

Steve


这篇关于问题构建Windows服务的安装项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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