How to start a ServiceStack console project as a Windows service?

I am creating a ServiceStack console application that works fine, but of course I have to leave it running after starting it from the command line. I want to run this as a windows service.

I look at this wiki page that says you can run SS as a Windows service.

https://github.com/ServiceStack/ServiceStack/wiki/Self-hosting

I did not quite understand how to do this. This StarterTemplate is referenced 2 years ago. Am I cloning this project and then copying the code into it?

https://github.com/ServiceStack/ServiceStack.Examples/tree/master/src/StarterTemplates/WinServiceAppHost

+6
source share
2 answers

The easiest way is to create a ServiceStack Windows Service Empty project in ServiceStackVS VS.NET Extension .

Otherwise, you can clone the WinService project and create a new Windows service project from Visual Studio and copy the approach into Program.cs .

A later ServiceStack Windows Service is the Razor Rockstars website , which runs on the Windows Service Host , whose template was based on the StartStart.examples Starter template.

+3
source

I use topshelf to run the servicestack console application as a windows service. This works very well for me. https://github.com/Topshelf/Topshelf

+2
source

Source: https://habr.com/ru/post/947684/


All Articles