I wrote part 7 of the series some time ago, titled: Building a Windows Service . It covers all the intricacies of construction services, makes them friendly for debugging and self-installation.
The main feature set I was looking for was as follows:
- Creating a service that can also be used from the console
- Own logging of service start / close and other actions
- Resolving multiple instances using command line arguments
- Self-Service and Event Log Installation
- Proper Service Exception and Error Logging
- Manage startup, shutdown and reboot options
- Handling custom service commands, session credentials, and events
- Security and access control settings
The end result was a Visual Studio project template, which in one step creates a working service full of all of the above. It was a great time saver for me.
see Building a Windows Service - Part 7: Finishing Touch for a link to a project template and installation instructions.
source share