0

My Scenario:

I have a Client\server set up on my desktop. I have 3 WCF Services installed through VS command prompt. Everything works fine during the installation but when i actually want to start the services it gives the following message

"The service on local machine has started and then stopped.Some Services stop automatically if they have no work to do,for example the performance logs and alerts service"

Can any one guide me to the solution ?

razlebe
  • 6,916
  • 6
  • 38
  • 53
Macnique
  • 988
  • 2
  • 17
  • 41

1 Answers1

0

The Windows service actually has to do something; otherwise, it will shutdown immediately and you'll get the error you're seeing. "Doing something" usually entails starting a thread in the OnStart() callback of the service. As @sgreeve provided in his comment, refer to the following question for a code example.

Windows Service Stops Automatically

It is also possible that the Windows service is throwing an exception when starting up. In this case, you'll probably want to debug the service to see exactly what is going on. Refer to the following question for how to do that.

Easier way to start debugging a windows service in C#

Community
  • 1
  • 1
Matt Davis
  • 43,149
  • 15
  • 89
  • 118