I like the generic host feature (introduced in asp.net core 3.x), because now you can easily run a web server and background workers within a same process. Furthermore, with a single line, you can with the .UseWindowsService()
method to convert this console app into a windows service (with the Microsoft.Extensions.Hosting.WindowsServices package's extension).
This is very nice!
But in the past, I was used to adding TopShelf in my windows services developments, as it did not require me to use the sc
command, or even the powershell dedicated commands. This was a real simplification for me, but even more for my customers. It really adds value (just tell them myapp install /option...
).
So my question is: how can I add this kind of feature in the asp.net core >=3.x ecosystem when running on windows? Is there anything existing/planned?
If not, how could I add that? When searching for a solution, I only find things relying on full .net (4.8 for instance).