I am trying to use ServiceController.ExecuteCommand on the service that I have created. The service has overridden the OnCustomCommand() method and all should work well... Except when I call ExecuteCommand from my windows application it throws an exception saying that it could not control the service because Access Denied.
I think it has something to do with the .Net framework code security because in the documentation for ExecuteCommand it mentions this, but I have no idea how to use it. Any ideas?
Error:
System.InvalidOperationException: Cannot control "myservicename" service on computer '.'. ---> System.ComponentModel.Win32Exception: Access is denied
Oh, and the current user logged in is a local and domain administrator.
Thanks.
I think it has something to do with the .Net framework code security because in the documentation for ExecuteCommand it mentions this, but I have no idea how to use it. Any ideas?
Error:
System.InvalidOperationException: Cannot control "myservicename" service on computer '.'. ---> System.ComponentModel.Win32Exception: Access is denied
Oh, and the current user logged in is a local and domain administrator.
Thanks.