0

I am trying to add my custom (not WCF) service to my WCF. It is hosting in Windows Service and in IIS.

I added call
serviceHost = new ServiceHost(typeof(MyService));
...
// ok, works.

When win service stopping it calls

if (serviceHost != null && serviceHost.State != CommunicationState.Closed) serviceHost.Close();

But my custom service still works. The question is: how to stop my service when host is stopped?

ZedZip
  • 5,794
  • 15
  • 66
  • 119
  • I'm not sure, If windows service stopped then it impossible that your service will be active. Looks like the service is not stopping properly or `serviceHost.Close()` is not getting called. – vendettamit Dec 16 '15 at 19:20
  • The reason is: it is not wcf service, it is my custom service. In other words: what serviceHost calls to stop hosting service? – ZedZip Dec 17 '15 at 08:50

0 Answers0