Shawn Weisfeld

I find when I talk to myself nobody listens. - Shawn Weisfeld
posts - 365, comments - 176, trackbacks - 34

My Links


Shawn Weisfeld's Facebook profile

The views expressed in this blog are mine and mine alone, not that of my employer, Microsoft, or anyone else’s. No warrantee is given for the quality of any material on this site.


Post Categories

WCF & Using Statements

I was attending the Dallas Connected Systems UG last night ( and during the presentation I made the bold assertion that one should NOT use the "using statement" when working with WCF. Now I am a HUGE proponent of the using statement in normal circumstances. IMHO if it implements IDisposable use the using statement, except with WCF. This has to do with the way that WCF errors out and when that happens how the connection gets closed. . .

Doing my best LeVar Burton "But you don't have to take my word for it" ( Microsoft even says it in the documentation, "You should not use the using statement (Using in Visual Basic) because it may mask exceptions in certain failure modes. " (

Also check out a post by Dan Rigsby that goes into more detail.

Print | posted on Thursday, November 13, 2008 11:29 AM | Filed Under [ .NET C# SOA VB.NET WCF ]


No comments posted yet.

Post Comment

Please add 7 and 5 and type the answer here:

Powered by: