Reputation: 5691
I've made a console application that I will turn into Windows Service. I want to have a WinForm GUI (exe file) for that Service, so I will be able to see all the information inside the Windows Service and control it in my WinForm GUI.
For example, if the windows service counts and saves the time passed (or any other information) I want to have access to it in my GUI (I want to see it live). As well as activating methods inside my Windows Service.
I hope I've made myself clear.
Upvotes: 0
Views: 1226
Reputation: 3365
The ServiceController
will only give you access to methods like Start, Stop.
To access any method, you will need to use some form of Inter-process Communication.
As suggested by Reed, WCF is one way...or you can try IPC through Named Pipes, remoting, etc.
Upvotes: 1
Reputation: 564413
My recommendation would be to use WCF for this. Your service could be a WCF host, and your client could connect to it.
This provides a fairly straightforward, clean way to "control" and inspect the service as much as required.
Upvotes: 3