Does Dispose still get called when exception is thrown inside of a using statement?

Yes, using wraps your code in a try/finally block where the finally portion will call Dispose() if it exists. It won’t, however, call Close() directly as it only checks for the IDisposable interface being implemented and hence the Dispose() method.

See also:

Leave a Comment