Click here to Skip to main content
15,894,630 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I have created a windows service and installed it successfully. But I am not able to start it. The following message comes whenever I try to start it.

"The <service name=""> Service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other services or programs".

Please suggest me how to start this service.
Thank you.
Posted

1 solution

You'll have to debug it. It could be getting an error. I suggest you look in the Event Viewer. Also make sure the Log On account has the proper permissions to do whatever it is your service does.

And lastly, make sure your service is not one of the kinds the message mentions, one that is only used by other services or programs and doesn't need to be constantly running.
 
Share this answer
 
Comments
Parag Soni 19-Feb-15 9:33am    
The Program doesn't contain any error. Also the service doesn't perform any special task for which permission could be needed. And how can I know the service type? I have created it in the same way in which any general service is created.
Why I am facing this problem?
ZurdoDev 19-Feb-15 9:35am    
Look in the event viewer.

Add logging to your service.
Parag Soni 19-Feb-15 10:07am    
I found the solution from event viewer.
Thanks a lot for your valuable suggestion.
ZurdoDev 19-Feb-15 10:08am    
Wonderful. Glad to hear it.
Parag Soni 19-Feb-15 10:11am    
Actually the .exe and .dll file used in that were not at the same location. Thats why.. :)

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