Seriously stop and use Topshelf, why?…
- Turns a console application into a windows service which allows much easier debugging
- Uses a fluent interface to setup your services allowing easy in code setup
- An instance can be provided at install allowing multiple same services on the same machine (which means you won’t need to read this)
The project site has a good Getting Started guide, once your ready to install the service, simply run this in a cmd prompt in the same directory as your exe:
myservice.exe install /instance:test
Advertisement