1

I have a windows application and I need to change it into a windows service, How can I check whether the windows service is running or not without using any external service to keep a check on the main service.

Is there any way to check it within the main service as I have tried work on it but if the windows service is stopped then there is no way I can check on it.

Do I have to implement the thread(keep alive thread) for this, if so then how to do it?

HotTester
  • 5,170
  • 15
  • 57
  • 93
user280154
  • 91
  • 1
  • 1
  • 3

2 Answers2

4

If your main service is not running, how can it check anything?

You have to have a second monitoring service of some kind.

Oded
  • 463,167
  • 92
  • 837
  • 979
3

Have a look at

Community
  • 1
  • 1
Adriaan Stander
  • 150,765
  • 27
  • 267
  • 275