Execute code when VisualStudio debugger is exiting

Viewed 2525

I had assumed that when terminating debugging (such as by hitting the Stop button, or hitting Shift+F5), that any class implementing a finalizer or IDisposable would be, well, disposed.

I have some classes that implement IDisposable. There are a few things I'd like to (try) and do as the application exits from the debugger (or from crashing in production). Right now, Dispose() does not appear to be called, nor a finalizer ~MyClass(){}

Is there a way to do this?

2 Answers
Related