[英]How to run a console app as a windows service? I'm getting confused by the “ClickOnce” files MS gives by default (VS 2008, C#)
This may seem a bit silly but I can't figure out where to start. 这似乎有些愚蠢,但我不知道从哪里开始。 I've found plenty of code online on how to do this, but I just don't know where to put it. 我已经在网上找到了大量有关如何执行此操作的代码,但我只是不知道将其放在何处。 I've created a console app that I'm trying to run in the background as a service (that will start when windows starts, close when windows closes etc..). 我创建了一个控制台应用程序,试图在后台作为服务运行(它将在Windows启动时启动,在Windows关闭时关闭等)。 I'm not sure what I should be doing to facilitate this though. 不过,我不确定应该采取什么措施来促进这一点。 Should I create a new project in the same solution? 我应该在相同的解决方案中创建一个新项目吗? Or a new class in the same project? 还是同一项目中有新班级? When I do create the service, how can I install it? 创建服务后,如何安装? Do I just publish it? 我只发布它吗? I've found some code online saying I should have a .exe file but all I have is ClickOnce? 我在网上找到了一些代码,说我应该有一个.exe文件,但我只有ClickOnce吗?
Thanks in advance... 提前致谢...
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.