简体   繁体   English

如何在.NET中安装Windows服务?

[英]How To Install A Windows Service In .NET?

I have created a console application in .Net 2.0 (C#) and want to create an installer that will install the application as a Windows Service. 我已经在.Net 2.0(C#)中创建了一个控制台应用程序,并且想要创建一个将应用程序作为Windows服务安装的安装程序。

I have never created an installer before but I am reading a few articles on the subject. 我以前从未创建过安装程序,但正在阅读有关该主题的几篇文章。 I would appreciate any suggestions or links from those with some experience in this area. 我将不胜感激那些在这方面有经验的人的任何建议或链接。

Thanks. 谢谢。

UPDATE: I am currently looking at http://justinjmoses.wordpress.com/2008/03/27/visual-studio-2008-standard-vs-professional/ to work around the fact that the Windows Service Application template is not included in VS 2008 Standard. 更新:我目前正在查看http://justinjmoses.wordpress.com/2008/03/27/visual-studio-2008-standard-vs-professional/,以解决Windows Service Application模板未包含在以下事实VS 2008标准。

Russ Taylor also has a default Windows Service project available for download at http://russtaylor.co.uk/2009/01/writing-a-windows-service-in-visual-studio-2008-standard/ . Russ Taylor还具有一个默认的Windows Service项目,可以从http://russtaylor.co.uk/2009/01/writing-a-windows-service-in-visual-studio-2008-standard/下载。

You should create a new "Windows Service Project" in Visual Studio. 您应该在Visual Studio中创建一个新的“ Windows Service Project”。

I think this is a good starting point: 我认为这是一个很好的起点:

Introduction to Windows Service Applications Windows服务应用程序简介

Apparently, the Windows Service Application Template is not available in the standard edition of Visual Studio, but maybe this can help: 显然,Windows服务应用程序模板在Visual Studio的标准版本中不可用,但这也许可以帮助您:

How to: Write Services Programmatically 如何:以编程方式编写服务

您希望在WiX中安装ServiceInstallhttp : //www.tentaclesoftware.com/blog/archive/2009/01/01/21.aspx

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM