I am trying to figure out how to open and close a ServiceHost object multiple times in a self-hosted WCF app:
what I did: 1. create ServiceHost object
How can I open the ServiceHost again in this case without recreating that object again (rather, I'd recreate CommunicationObject if it is possible).
Thanks in advance.
ServiceHost inherits from CommunicationObject. ServiceHost is the CommunicationObject throwing the exception. Once a CommunicationObject is Closed it cannot be reopened. You'll have to create a new ServiceHost.
The CommunicationState state machine:
Every object starts in the Created state and proceeds in a one-way progression through the Opening, Opened, Closing, and Closed states.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With