ryudice
ryudice

Reputation: 37376

Managing instance lifecycle of WCF client

Is it OK to store a WCF client instance on a singleton to use on the whole appdomain? Also are you suppose to manage the state of the client because I see it has a Close and Open method?

Upvotes: 0

Views: 535

Answers (1)

vcsjones
vcsjones

Reputation: 141648

I would not store it as a singleton. If you do and it ends up in a Faulted state, you'll have some trouble. Use it as an instance, and properly Close and Dispose of it.

Upvotes: 2

Related Questions