0

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?

ryudice
  • 36,476
  • 32
  • 115
  • 163
  • Exact duplicate: http://stackoverflow.com/questions/563525/what-are-the-pitfalls-of-using-a-shared-static-wcf-proxy-client – Oskar Kjellin May 24 '11 at 20:45

1 Answers1

2

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.

vcsjones
  • 138,677
  • 31
  • 291
  • 286