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

问题描述

伙计们。我是Windows服务的新手,他们让我头疼。我使用的是VB.Net 2010 Professional。我完成了编码,使用[ServiceProcessInstaller1]和[ServiceInstaller1]创建了[ProjectInstaller]。当转到[设置和部署],选择[设置项目]时,问题开始。在我单击确定之前,有一个[解决方案]选项。其默认值为[创建新解决方案]。当我使用此选项单击确定时,我看不到[primaryoutput]。所以我选择[添加到解决方案]。然后我按照这些步骤



右键单击[Setup1],选择[查看]然后[自定义]

右键单击[自定义操作],然后[添加自定义操作]。所有文件夹都是空的,没有什么可供选择。



我回到[Setup1],右键单击,选择[添加],[项目输出]然后选择[主输出]

,配置为[Active],默认为单击确定。

[WindowsService1的主要输出]出现



我再次添加自定义操作,选择[主输出]



右键单击[Setup1]并选择[Rebuild]



我转到我保存项目的桌面,我看到一个名为[setup1]的文件夹,其中包含2个空文件夹[debug]和[release]以及[setup1]文件。希望它会安装,我双击它,它再次打开visual studio。



选项[install]和[unninstall]被禁用。当我设法启用它们时,不知道程序似乎如何安装

但是当我检查服务时,我的服务不可用



我再次重建但是这个错误

[无法构建名为'来自WindowsService1(Active)的主输出的自定义操作',因为它引用了已从项目中删除的对象。 C:\ Users\admin \Desktop\WindowsService1 \ Setup1 \Setup1.vdproj Setup1]



我错过了什么,我跟随了以下示例net,microsoft的演练示例。



请帮助

Hi again guys. I am really new to windows services and they are giving me a headache. I use VB.Net 2010 Professional. I am done with coding, created the [ProjectInstaller] with [ServiceProcessInstaller1] and [ServiceInstaller1]. The problem starts when goto [Setup and Deployement], choose [Setup Project]. Before i click OK there is a [Solution] option. The default value for that is [Create new solution]. When i click ok with this option i do not see [primaryoutput]. So I choose [Add to Solution] instead]. Then I follow these steps

Right click on [Setup1], choose [view] then [custom]
Right click on [Custom Actions], then [Add Custom action]. All of the folders are empty, there is nothing to select.

I go back to [Setup1], right click, select [Add], [Project Output] then choose [Primary Output]
with configuration [Active] selected as default i click ok.
[Primary Output from WindowsService1] appears

I add custom action again, select [Primary Output]

Right click on [Setup1] and select [Rebuild]

I go to desktop where i saved the project, i see a folder named [setup1] with 2 empty folders [debug] and [release] plus [setup1] file. Hoping it would install, I double-click on it and it opens visual studio again.

options [install] and [unninstall] are disabled. When i managed to enable them, dont know how
the program seemed to install but when i check under services, my service is not available

I rebuilt again but this error
[Unable to build custom action named 'Primary output from WindowsService1 (Active)' because it references an object that has been removed from the project. C:\Users\admin\Desktop\WindowsService1\Setup1\Setup1.vdproj Setup1]

What i am i missing, i followed examples from the net, microsoft's walkthrough example.

Please help

推荐答案


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

09-13 11:05