解决方法
我在回答你的另一个问题时已经告诉过你了 – 你可能想看看一些“混合”方法,它们可以让你首先把你的代码编写为命令行应用程序(可以很容易地调试),一旦它工作正常,然后您可以将其安装为服务:
> HybridService: Easily Switch Between Console Application and Service
> Hybrid Windows Service
> TopShelf – a service-construction helper for .NET