Yu Guan provides best practices for developing Windows services including:
- Separating business logic into individual projects for implementation segmentation.
- Using an installer component marked with the [RunInstaller(true)] attribute for installation.
- Debugging services by running in console, attaching a process, or using Debugger.Launch() and Debugger.Break().
- The DevLib.ServiceProcess NuGet package and source code on CodePlex which provides an easy way to port services and solve common pain points.