Converting a Console Application to a service?

前端 未结 5 933
[愿得一人]
[愿得一人] 2021-02-06 05:53

I\'m looking for different ways with strengths/weaknesses for converting a console application we are using long term in to a windows service. We use something called java serv

5条回答
  •  梦如初夏
    2021-02-06 06:48

    I ran into this same issue, I ended up writing my own wrapper, it's only good for the simplest situations but it does have it's perks. You can find the tool here: http://runasservice.com. Some of the perks include the fact that you can code your application as a console application which is easy to test and run in the IDE. Setting it up a service involves one simple command so you don't have to edit your application. Also you can install the service multiple times with different names, which you might want to do if you want to run each with different parameters.

    Like I said though it's only covers the simplest scenarios, applications that are already essentially services. That is they run continuously. I'm sure there are a lot of other services out there that give you a lot more options.

    Personally I don't think it's particularly difficult to convert a console application, but it can be a hassle to test. At the end though it depends on how much control you want. If it's a really important service for your company, then I would say convert it.

提交回复
热议问题