0

I could do with a bit of help with a windows service im writing in c#. The service basically just runs various tasks on a schedule. It has 3 main sections: a class which contains everything for the task (config, code to be executed when it runs, etc), the service which contains instances of the tasks, running them on a timer and a windows form which is used to configure the settings for the task.

The question I have is would it be possible to reference the service from the Winform whilst the service is running? Ultimately I want to be able to open the Winform and see a live status of what the service is currently doing.

I've considered writing something network related to get around it but it didn't seem correct considering that both processes would be on the same machine.

default locale
  • 13,035
  • 13
  • 56
  • 62
Rich
  • 561
  • 1
  • 4
  • 11
  • 1
    It would likely make more sense for the service to maintain its current state in a database and for the application to check that database. – David Jun 24 '13 at 22:53
  • 2
    possible duplicate of [What is the best choice for .net inter-process communication?](http://stackoverflow.com/questions/84855/what-is-the-best-choice-for-net-inter-process-communication) – Andrew Savinykh Jun 24 '13 at 22:54
  • I did think about that too but wasn't sure if there was a better way. That certainly sounds easiest though. Thanks – Rich Jun 24 '13 at 22:57
  • Couldn't you use WCF to self host an endpoint? Then have your winform app connect to that endpoint/binding? That would probably work the best, depending on what stats you are updating, would be faster than write/read to disk... – Matt Jun 25 '13 at 04:20

0 Answers0