I have a WPF application that uses WCF service. Service instance context mode is set to PerSession. In the service there is a method with a callback to the client that sends messages received from external queue.
When I start new service and run application everything works fine, callback channel has open state. When I close application and run it again callback always throws 'Cannot access disposed object' error and has Closed state.
To connect to the service form client side I use DuplexChannelFactory, after closing application channel and channel facotry are disposed. I can see in logs that Closing and Closed events were invoked. I thought that maybe service is holding last session or when I re-run the application it connects to the same channel that was closed. I checked session Ids, and they are different. UUid is the same.
For me it looks like client app is using the same channel after restart. Is service side caching something about channels?
I hope I gave enough explanation. I will provide more information if needed. Any ideas how to solve this issue?
Thanks