安装后 Windows 服务未出现在服务列表中 [英] Windows Service not appearing in services list after install

查看:19
本文介绍了安装后 Windows 服务未出现在服务列表中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Visual Studio 2008 在 C# 中创建了一个 Windows 服务我几乎遵循了这个:http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx

I've created a windows service in C#, using Visual Studio 2008 I pretty much followed this: http://www.codeproject.com/KB/dotnet/simplewindowsservice.aspx

我按照文章中的说明创建了一个安装项目,然后运行它...它将我的服务安装到 C:Program FilesProduct etc.... 但是,它没有出现在服务列表中..

I created a setup project, as instructed to in the article, and ran it... it installs my service to C:Program FilesProduct etc.... however, it does not then appear in the services list..

我错过了什么?

推荐答案

您链接的文章中最重要的部分在这里

The most important part of the article you linked, is here

向设置项目添加自定义操作

1.在解决方案资源管理器中,右键单击安装项目,指向查看,然后选择自定义操作.风俗出现动作编辑器.

1.In Solution Explorer, right-click the setup project, point to View, then choose Custom Actions. The Custom Actions editor appears.

2.在自定义操作编辑器中,右键单击自定义操作节点并选择添加自定义操作.这在项目对话框中选择项目出现.

2.In the Custom Actions editor, right-click the Custom Actions node and choose Add Custom Action. The Select Item in Project dialog box appears.

3.双击列表框中的应用程序文件夹打开,选择MyNewService 的主要输出(活动),然后单击确定.首要的输出添加到所有四个节点自定义操作 安装、提交、回滚和卸载.

3.Double-click the application folder in the list box to open it, select primary output from MyNewService (Active), and click OK. The primary output is added to all four nodes of the custom actions � Install, Commit, Rollback, and Uninstall.

4.构建安装项目.

如果您跳过这些步骤,您的安装项目将构建并将您的文件复制到正确的目录;但是,如果没有这些步骤,他们不会将您的二进制文件注册为服务.

If you skip these steps, your setup project will build and copy your files to the correct directory; however, they will not register your binary as a service without these steps.

我还应该注意,这适用于具有/具有内置安装/部署项目模板的旧版 Visual Studio.较新版本的 Visual Studio 具有不同的安装/部署项目(有些需要第三方软件.)

I should also note that this works for older versions of Visual Studio that had/have the built-in Setup/Deployment project template. The newer versions of Visual Studio have different setup/deployment projects (some requiring third party software.)

我建议您查看 WiX 工具集 并在此处查看 Windows 服务的 WiX 安装.

I'd recommend looking into WiX Toolset and check here for WiX Installation of Windows Services.

这篇关于安装后 Windows 服务未出现在服务列表中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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