Click here to Skip to main content
16,022,418 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
assalamualaikum
while installing windows service i get this error

" cannot start service from the command line or a debugger. A windows
service must first be installed using installutil.exe"
kndly help
Posted

I think your windows service may be not installed properly or uninstalled.

If you have the VS.NET command prompt, just type installutill <service>
where <service> is the complete path to the executable file in your bin
directory. This will install the service for you, where you can control it
from the services manager under Administrative tools in your control panel.

To uninstall the service, just type installutil -u <service>.
If you do not have a VS.NET command prompt, it's no big deal, you just have to specify the full path for the installutil program, which is I think by default under <your windows dir>\Microsoft.Net\framework\framework version dir\installutil.exe.



HTH
 
Share this answer
 
Hi Make sure you have added an installer while creating windows service. To add the installer to the project, right click on Service1.cs Design pane and choose Add Installer. You will see two object added to your Windows Service project serviceInstaller1 and serviceProcessInstaller1

Set the properties Display Name, Service Name and Start Type (Manual, Automatic, Disabled for the installer Service Installer

and then build --> From the VS.Net command prompt
installutil /i Your windows service exe path
 
Share this answer
 
Comments
khaula 2 20-Jul-10 3:50am    
ok..thanx..i did that but then in command prompt i get this result

"the transacted install has completed.
the installation failed and rollback has performed"...
why my installation failed??although i performed all the steps right?=(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900