I have two services, one that calls another. Both are marked as singletons as follows:
[ServiceBehavior(InstanceContextMode = InstanceContextMode.Single,
ConcurrencyMode = ConcurrencyMode.Multiple)]
public class Service : IService
And I set these up with a ServiceHost as follows:
ServiceHost serviceHost = new ServiceHost(singletonElement);
serviceHost.Open();
When the parent service tries to call the child service on the same machine, the parent service hangs, waiting for the child service.
I'm already considering moving away from the singleton model, but is there anything wrong with my approach? Is there an explanation for this behavior and a way out of it?