There is also another way to implement a Windows service using TopShelf . In fact, you can run the console application as a Windows service using topshelf. Its advantage is easy to debug. As far as I know, when you want to debug a Windows service, you start the service in the service console. Stop the service if you directly compile and install the service from the assembly. This is an additional painful step.
If you use topshelf, you can start a service, for example, how to start a Windows forms application for debugging. There are other benefits. Please refer to the website.
source share