In earlier versions of C#.Net an issue exists when disposing of WCF Proxies (Service Reference generated clients) - Does this still exist in .Net 4.5+?
Full details of this issue can be found here... https://coding.abel.nu/2012/02/using-and-disposing-of-wcf-clients ...but to summarize, essentially the IDisposable implementation on the Service Reference generated proxy, unconditionally called Close() without first checking the State. If an unhandled exception was ever thrown from the service being called, this would fault the channel, and then doing ANYTHING with the proxy (including trying to call Dispose()) would give rise to a secondary CommunicationException - obfuscating the original exception, and leaving the Proxy in an un-usable state. With this in mind, one couldn't really wrap the proxy in the using{} construct despite the fact that it implemented IDisposable, and it was largely regarded as a WCF bug.
Several patterns exist for dealing with this, and I'm not going to cover them here. What I need to know is, as it was largely regarded as a WCF bug, has it been fixed? I can't find anything on the interweb to suggest that the flawed implementation of IDisposable is no longer flawed??
UPDATE: I've just found this... https://msdn.microsoft.com/en-us/library/aa355056(v=vs.110).aspx ...which suggests it's still an issue. Can't believe it hasn't been fixed yet. This issue has been around since WCF first appeared. What's the point of implementing IDisposable on these proxies??
UPDATE: I've just found this... https://msdn.microsoft.com/en-us/library/aa355056(v=vs.110).aspx ...which suggests it's still an issue.
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