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

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

我以前从未创建过安装程序,但正在阅读有关该主题的几篇文章。我将不胜感激那些在这方面有经验的人的任何建议或链接。

谢谢。

更新:我目前正在研究http://justinjmoses.wordpress.com/2008/03/27/visual-studio-2008-standard-vs-professional/,以解决Windows Service Application模板未包含在VS 2008 Standard中的事实。

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

参考方案

您应该在Visual Studio中创建一个新的“ Windows Service Project”。

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

Introduction to Windows Service Applications

显然,Windows服务应用程序模板在Visual Studio的标准版中不可用,但这也许可以帮助您:

How to: Write Services Programmatically

如何在.Net Core中的AuthorizeAttribute类中访问appsetting.json参数 - c#

在我的ASP.NET Core MVC应用程序中,我有一个从AuthorizeAttribute继承并实现IAuthorizationFilter的类。namespace MyProject.Attributes { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Method, Allow…

如何在.net core中调用带参数的动作? - c#

因此,我在Startup.cs中设置了以下默认模式:app.UseEndpoints(endpoints => { endpoints.MapControllerRoute( name: "default", pattern: "{controller}/{action}/{id?}"); }); 这是我的控制器…

如何在.NET服务器端检索Http请求参数 - c#

我已经使用XmlHttpRequest调用了.NET DLL(类库项目):function httpGet(theUrl, sendParam) { var xmlHttp = null; xmlHttp = new XMLHttpRequest(); xmlHttp.open('POST', theUrl, false); xmlHtt…

SQLite。修复sqlite-net-wp8项目依赖项 - c#

为什么SQLGet在NuGet上不可用?为什么它是Visual Studio的一部分,您必须在“工具”->“扩展和更新”中查找更新?在过去的几个月中,我开始对Windows 8和Windows Phone 8进行编码,我希望对此有所了解。对我来说,在Windows 8项目上使用SQLite会创建VS级依赖关系。假设我使用Visual Studio ID…

如何使用ASP.NET ViewState使用JavaScript - c#

我的页面中有UL,它为空。我开始使用JavaScript使用LI填充它。在回发阶段如何在asp.net中使用此新添加的动态数据?那是因为我的提交按钮是asp.net控件。我不想使用JS POST。谢谢 参考方案 我过去通过在隐藏字段中填充要发布的动态数据来完成此类操作,您可以-在回传之前触发JavaScript事件,该事件将数据从UL解析到隐藏字段中要么更新…