Sample Windows service with NLog.
This version is debuggable from within Visual studio and launchable as console application.
General functionality:
The service perform required operations once the Timer is elapsed.
On exception, it waits for N time and launches the same worker again until the service is stopped
or the worker thread exits without exceptions.
Steps to launch as console app after compilation:
- Create shortcut to compiled EXE file.
- In properties of the shortcut add " console" after executable file path.
- Save shortcut changes.
- Run the shortcut.
To install service:
1) Run compiled .exe file with attribute "install"
To uninstall service:
1) Run compiled .exe file with attribute "uninstall"