When I create a new Windows Service in Visual Studio 2010, I get the message stating to use InstallUtil and net start to run the service.
I have tried the following
Another possible problem (which I ran into):
Be sure that the ProjectInstaller class is public. To be honest, I am not sure how exactly I did it, but I added event handlers to ProjectInstaller.Designer.cs, like:
this.serviceProcessInstaller1.BeforeInstall += new System.Configuration.Install.InstallEventHandler(this.serviceProcessInstaller1_BeforeInstall);
I guess during the automatical process of creating the handler function in ProjectInstaller.cs it changed the class definition from
public class ProjectInstaller : System.Configuration.Install.Installer
to
partial class ProjectInstaller : System.Configuration.Install.Installer
replacing the public keyword with partial. So, in order to fix it it must be
public partial class ProjectInstaller : System.Configuration.Install.Installer
I use Visual Studio 2013 Community edition.