What is the accepted pattern for an application that can be run as a service or as a console application

前端 未结 4 858
半阙折子戏
半阙折子戏 2021-02-06 16:43

I have a project that is deployed to production as a windows service. However for local development purposes it would be useful to run it as a console application. At the moment

4条回答
  •  伪装坚强ぢ
    2021-02-06 17:26

    There are already two good answers above - but I thought I'd post a link to Brian Noyes' Debuggable Self-Host Windows Service Project blog post - it talks about WCF but should apply to any 'Windows Service'.

    The best thing is the sample code - if you can't figure out where the above examples 'fit', grab the complete project and see how it works. Thanks Brian!

提交回复
热议问题