- Stackoverflow reference question.
GOAL Create an windows service based on a Console Application. My end solution is aggregation of the results with some clean up.
Mainly the method OnStart and OnStop need to be implemented, they are part of ServiceBase class. With Visual Studio, go to new project and pick Windows Service (C# in my case).
Override the OnStart and OnStop method. Basic tutorial that helps to create the basic steps. (it’s ugly but quite helpful)
Install the service
How to install windows services with PowerShell:
My goal is manage everything with the build server, so I just rely on bash.
Create
Query
Delete
In theory this should work, but in my case it just flaged the service to be removed and I had to restart windows:
In other hand this works like a charm:
How to install windows services with cmd (boring):
Examples:
Send me email if any question…