Catching exceptions thrown in the constructor of the target object of a Using block
问题 using(SomeClass x = new SomeClass("c:/temp/test.txt")) { ... } Inside the using block, all is fine with treating exceptions as normal. But what if the constructor of SomeClass can throw an exception? 回答1: Yes , this will be a problem when the constructor throws an exception. All you can do is wrap the using block within a try/catch block. Here's why you must do it that way. using blocks are just syntactic sugar and compiler replaces each using block with equivalent try/finall block. The only