How to call windows service from windows application - (Vista issues) XP is ok
Posted on 2007-11-15
I wrote a windows service and a windows application in VS2005 in VB. The application monitors a folder for changes and calls the windows service if there are new files added to the folder. The windows service FTP's the files to an FTP server then shuts down and the application continues running.
The program works flawlessly on XP, but on Vista, the windows application fails to call the windows service. I'm using a ServiceController and in the code I have Me.ServiceController1.Start(). I have error/success messages from the application and service writing to a custom event log I've created for this, but the only error message I'm getting is "Cannot open <service Name> on computer '.' " The properties for the ServiceController have the right ServiceName and have a single decimal for the MachineName since the service is local. How do I fix this so my application calls the service successfully? Since all I really want to do is call the windows service, is there a different way or a better to do what I'm looking for?