I have a simple console app that is a self hosted service and a second console app that acts as the client. I can pass a message between the client and service. Obviously for this to work the service has to stay up and running,
so I put a Console.ReadLine(); command as the last line in the service console app to prevent the service from closing until the user presses enter.
My problem is, I would like to (self)host the service in a windows form. If, for example, I put the ServiceHost decleration in the form load method, the service does not stay open once the form load method is complete.
Does anyone have any tips on how I can self host the service in a windows form application and keep the service alive?
View Complete Post