1

Is there anyway to call a windows service that's already running or a process to get info? What my goal is to find out if my windows service is an infinite loop or dead lock and see if it responds. So I want to be able to pass an argument from another program to a windows service and want it to to return a string or number. Is this possible? I can change the windows service to accommodate this. I am thinking of an event or something.

Note: I am not supposed to have the service write to a file or database.

Rafi W.
  • 154
  • 2
  • 11
  • Possible duplicate: http://stackoverflow.com/questions/3325081/how-to-check-if-a-service-is-running-via-batch-file-and-start-it-if-it-is-not-r – Vaibhav Desai Nov 07 '12 at 03:24
  • You can use ControlService Win32 API to query a service for it's current status. If just knowing status would suffice. And status is basically a number. – nanda Nov 07 '12 at 06:01

1 Answers1

0

You can host a WCF service in your Windows Service which you could call to get status information.

Here are a couple of links on doing that:

Can I host a WCF Service in a windows service?

How to: Host a WCF Service in a Managed Windows Service

Community
  • 1
  • 1
Mike Parkhill
  • 5,511
  • 1
  • 28
  • 38