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,380
  • 15
  • 59
  • 95
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
  • 477,625
  • 97
  • 867
  • 998
3

Have a look at

Community
  • 1
  • 1
Adriaan Stander
  • 156,697
  • 29
  • 278
  • 282