[英]starting windows service development using .net
I have started working with the C# from couple of months and now i am starting with the windows service. 我从几个月开始使用C#,现在我开始使用Windows服务。 MSDN is good as always to start with but i would like to know if there is book, blog ... etc (dedicated) for this which could be a nice starting point ? MSDN一如既往的好,但我想知道是否有书,博客......等(专用)这可能是一个很好的起点?
I found the following useful to me when I started making services: 当我开始提供服务时,我发现以下内容对我有用:
It the same as a console app, just without a console (and a little extra setup). 它与控制台应用程序相同,只是没有控制台(以及一些额外的设置)。
I have written many console apps that can run as a service too, you can achieve this in less than 5 lines of code. 我已经编写了许多可以作为服务运行的控制台应用程序,您可以在不到5行代码中实现这一点。
Your best bet is just to use the default VS template for a service, and see how little difference there really is. 您最好的选择就是使用默认的VS模板进行服务,看看实际上差异不大。
There are some things to watch out for however. 但是有一些事情需要注意。
What is the reason for choosing windows services as you execution environment? 在执行环境中选择Windows服务的原因是什么? Generally, these are avoided if possible (particularly for people new to .NET). 通常,如果可能,可以避免这些(特别是对于.NET新手)。 They can be sort of cranky and are rather opaque. 它们可能有点胡思乱想,而且相当不透明。 By all means, if your requirements neccesatate a windows service, go for it, but if not, I'd start elsewhere. 无论如何,如果你的要求需要一个Windows服务,那就去吧,但如果没有,我会从其他地方开始。
如果要使用C#和Visual Studio 2008创建Windows服务,可以按照此处的分步说明进行操作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.