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

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

问题描述

我创建了一个C#中的窗口服务,使用Visual Studio 2008
我pretty多遵循这个:
<一href=\"http://www.$c$cproject.com/KB/dotnet/simplewindowsservice.aspx\">http://www.$c$cproject.com/KB/dotnet/simplewindowsservice.aspx

我创建了一个安装项目,在文章中指示,并运行它...
它安装我的服务到c:\\ Program Files文件\\产品等....但是,它不会再出现在服务列表中。

我想什么?


解决方案

在链接的文章最重要的部分,就是这里了。


  

要自定义操作添加到安装项目


  
  

    

1.In Solution Explorer中,右键单击安装项目,指向视图,然后
    选择自定义操作。自定义
    出现动作编辑器。


    
    

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


    
    在列表框中打开它

3.双击应用程序文件夹,选择
    从MyNewService主输出
    (活动),然后单击确定。首要的
    输出被加至所有四个节点
    自定义操作安装,提交,
    回滚和卸载。


    
    

4.Build安装项目。


  

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


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

我建议寻找到的WiX工具集并检查这里的WiX安装Windows服务的。

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

I created a setup project, as instructed to in the article, and ran it... it installs my service to c:\program files\product etc.... however, it does not then appear in the services list..

What am i missing?

解决方案

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

To add a custom action to the setup project

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

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.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.Build the setup project.

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.


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.)

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

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

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