Reputation: 191
I am trying to start my Windows services application but i am getting the following error
Cannot start service from the command line or a debugger. A Windows Service must first be installed (using installutil.exe) and then started with the ServerExplorer, Windows Services Administrative tool or the NET START command.
Could someone please help me on this..
Upvotes: 2
Views: 9454
Reputation: 164
when you have builded your windows service you have to install it before you can start it: here is the install command line:
installutil YourNewService.exe
You see then the new service in windows service manager, where you can start and stop it.
And don't forget to unistall your new service before you try again with a new build version.
Look here for more informations: How to: Install and Uninstall Services
best regards
Upvotes: 0
Reputation: 384
As they say in the comments - you can't start a windows service unless you install it and run it from the Service Manager (Services)
A solution: I would recommend to add a console main entry point in your C# service program so you can actually start it from both the Service Manager and debugger / exe execution.
http://einaregilsson.com/run-windows-service-as-a-console-program/
Upvotes: 1