Click here to Skip to main content
15,896,726 members
Articles / General Programming / Performance

Do not use "using" for WCF Clients

Rate me:
Please Sign up or sign in to vote.
4.83/5 (26 votes)
17 May 2011CPOL1 min read 117.4K   39  
Traditional using() block disposes WCF clients incorrectly when there's a communication exception, eg dropping network connection. It raises exception during the dispose and thus the resources held by the WCF client aren't released properly. After some time, you end up with memory leaks.

Views

Daily Counts

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Architect BT, UK (ex British Telecom)
United Kingdom United Kingdom

Comments and Discussions