I have created the following C# program:
namespace dispose_test { class Program { static void Main(string[] args) { using
If you surround this with a try-catch, the finally block will run when the exception is caught (handled) by the outer catch.
static void Main(string[] args) { try { using (var disp = new MyDisposable()) { throw new Exception("Boom"); } } catch (Exception e) { throw; } }