Hacker News new | ask | show | jobs
by ifross 4507 days ago
There are known issues with using "using". If the Dispose() call throws an exception in the finally block, then any exception that occurred in the within the using block is masked.

The easy solution is to make sure that your Dispose() calls don't throw exceptions, unfortunately some of Microsoft's classes don't conform to this (e.g. WCF clients).

The following MSDN article shows a case where they do not recommend using "using", and instead suggest explicitly using try-catch-finally: http://msdn.microsoft.com/en-us/library/aa355056.aspx