Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/.net/21.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 如何在.NET中安装Windows服务?_C#_.net_Windows Services_Installation - Fatal编程技术网

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

C# 如何在.NET中安装Windows服务?,c#,.net,windows-services,installation,C#,.net,Windows Services,Installation,我已经在.NET2.0(C#)中创建了一个控制台应用程序,并希望创建一个安装程序,将该应用程序作为Windows服务安装 我以前从未创建过安装程序,但我正在阅读一些关于这个主题的文章。我非常感谢在这方面有经验的人提出的任何建议或链接 谢谢 更新:我目前正在考虑解决Windows服务应用程序模板未包含在VS 2008标准中这一事实 Russ Taylor还有一个默认的Windows服务项目可供下载。您应该在Visual Studio中创建一个新的“Windows服务项目” 我认为这是一个很好的起点

我已经在.NET2.0(C#)中创建了一个控制台应用程序,并希望创建一个安装程序,将该应用程序作为Windows服务安装

我以前从未创建过安装程序,但我正在阅读一些关于这个主题的文章。我非常感谢在这方面有经验的人提出的任何建议或链接

谢谢

更新:我目前正在考虑解决Windows服务应用程序模板未包含在VS 2008标准中这一事实

Russ Taylor还有一个默认的Windows服务项目可供下载。

您应该在Visual Studio中创建一个新的“Windows服务项目”

我认为这是一个很好的起点:

显然,Windows Service应用程序模板在Visual Studio的标准版中不可用,但这可能会有所帮助:


您需要WiX中的
ServiceInstall

谢谢。它说服务应用程序模板在VS的标准版中不可用(我有)。可以手动安装此模板。是否需要使用服务模板?控制台应用程序不能工作吗?@modernzombie:你可以通过编程方式创建服务,我已经更新了答案。