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?