For a Windows Service we are building, we are using Topshelf:
Topshelf is a framework for hosting services written using the .NET framework. The creation of services is simplified, allowing developers to create a simple console application that can be installed as a service using Topshelf. The reason for this is simple: It is far easier to debug a console application than a service. And once the application is tested and ready for production, Topshelf makes it easy to install the application as a service.
Great tool and a lot easier during debugging and development! However when I tried to install the final exe as a windows service using installutil.exe it failed with the following error message:
"No public installers with the RunInstallerAttribute.Yes attribute could be found in the SampleService.exe assembly."
Turns out that you don’t need the installutil.exe tool when you are using Topshelf. Instead you should invoke your executable with the ‘install’ option:
SampleService.exe install
More information:
http://docs.topshelf-project.com/en/latest/overview/commandline.html