In my case, I was publishing service while it was in debug mode.
Solution was:
- Changing solution to release mode
- Uninstall old service with command
InstallUtil -u WindowsServiceName.exe - installing service again
InstallUtil -i WindowsServiceName.exe
It worked perfectly after.