views:

198

answers:

2

Hi,

I have installed a windows service(C#) on my local machine having windows XP installed in it.

But when I tried to start that service It gave me this error-

The MyWindowsService service on Local Computer has started and then stopped. Some Services stops automatically if they have no work to do, for example, the performance logs and Alert Service.

Do you have any idea why this service isn't started?

Regards,

nzahra

A: 

Check the account this service is running under. The user account should have enough privileges to be able to logon on as a service. This link may help out as well.

Kashif Awan
Wouldn't you get an error in event log if that was the problem?
Sam
Yes you would get an entry in event log.
Kashif Awan
+3  A: 

Add a System.Diagnostics.Debugger.Break() call at the start of your Main() method. Then you can step through your service to see what's going wrong.

Sam