T
Tom J
What do I have to do to get
System.ServiceProcess.ServiceController.ExecuteCommand(int) to work?
I have written a service that overrides OnCustomCommand to handle commands
sent to it.
If I have application code like:
----------------------------------------------------------
ServiceController sc = new ServiceController("MyService");
sc.Start(); // this works
...code that checks running state is here...
sc.ExecuteCommand(1); //throws the exception
---------------------------------------------------------
I get an exception of: Cannot control MyService service on computer "."
Are there specific things i have to do to the service to allow it to accept
commands other than the standard start, stop, etc?
Thanks in Advance....Tom J
System.ServiceProcess.ServiceController.ExecuteCommand(int) to work?
I have written a service that overrides OnCustomCommand to handle commands
sent to it.
If I have application code like:
----------------------------------------------------------
ServiceController sc = new ServiceController("MyService");
sc.Start(); // this works
...code that checks running state is here...
sc.ExecuteCommand(1); //throws the exception
---------------------------------------------------------
I get an exception of: Cannot control MyService service on computer "."
Are there specific things i have to do to the service to allow it to accept
commands other than the standard start, stop, etc?
Thanks in Advance....Tom J