- Easy installation and deinstallation
- Easy service name change without rebuild (through app.config)
- Built-in debug mode. You no longer need a separate console application to debug your service
- Clone or download the project
- Rename WinSvc.csproj as you need
- Connect the project to your solution
- Change the project assembly name and namespace
- If you using VisualStudio or Rider with installed VisualStudio 2017 -
install.bat
anddelete.bat
will be regenerated on build. Otherwise you'll need to update them yourself with new assembly name. - Configure
ServiceName
in app.config - Implement
OnStart
andOnStop
behavior in MyService.cs
To install your service as Windows Service
- Build the project
- Start
install.bat
from the output dir (with admin) - Now you can see your service in the Windows Services list
To uninstall your Windows Service run delete.bat
with admin. That's stop your service and removes it from the Windows Services list.
To debug your service configure your IDE to start the project with /d
key. Now just hit 'F5' without any service installation.
Autogenerate install.bat and delete.bat on build- Autogeneration without VisualStudio installed
- Create Rider project template