0

I read this Article and I thought I write a little ping Service (Both Service and Client can ping). however, when I use

[ServiceBehavior(InstanceContextMode=InstanceContextMode.PerSession, 
             ConcurrencyMode = ConcurrencyMode.Multiple)]

My ping service only creates one instance. But I want multiple instances. My callback interface is saved in a private but it is overwritten because when the clients register, they register to one instance and not different. Is that Bad design in my case or why does wcf only create one instance?

Iron
  • 477
  • 4
  • 19
  • http://stackoverflow.com/questions/12412111/multiple-instances-of-a-self-hosted-wcf-service – butterbox Jul 22 '14 at 07:30
  • How are you testing whether you only have 1 instance? If you're testing this using the WcfTestClient from VS, I think that thing only generates one session. You need to call from different clients to get different sessions. – Nzall Jul 22 '14 at 07:35
  • I have one VS client and one remote client on an other computer – Iron Jul 22 '14 at 07:37

1 Answers1

1

The problem was with the Windsor Container. When I instanciate a Component with ´.AsWcfService´ Windsor doesn't care about the ServiceBehavior. So I need to set the lifestile to transient for this case.

Iron
  • 477
  • 4
  • 19