Hi!
I have an old service that was originally written in .NET 2.0 and all services and monitors were run under Windows XP.
How ever all the clients are now Windows Vista and higher.
From my service controller app i can send custom commands to my service, these works fine, but i cant send Start and Stop methods to the service controller. I get an exception doing this.
I think i need to do something with the ServiceControllerPermission but I just don't know how.
The service is installed and running under Local System account.
The code is very straight forward:
public partial class MainApp : Form
{
private Timer WaitForService;
public MainApp()
{
InitializeComponent();
this.WaitForService = new Timer();
WaitForService.Tick += new EventHandler(WaitForService_Tick);
}
public StopService()
{
FTPServiceController.Stop();
}
}
Any tips ideas are greatly appreciated.
BTW, if i run my app as an administrator it works, so i guess i need to set some permissions in the app somehow.
Regards
Martin Arvidsson
No comments:
Post a Comment