I'm developing an ArcMap add-in using .NET and Visual Studio 2012. I've set the debugging option for the project to start ArcMap. Ordinarily, when I shut down ArcMap, I'm returned to Visual Studio and debugging stops.
EXCEPT when I open this one particular document in ArcMap. Then, I'm returned to Visual Studio, but the debugging process doesn't stop. The ArcMap process is still running and consuming about 50% CPU (on a 4 core machine).
If I run ArcMap by itself with the compiled add-in, ArcMap shuts down normally.
It almost seems like I'm hanging on to an unmanaged resource somewhere, but I created another map document that has content that causes the same objects to be created, and ArcMap shuts down normally and returns me to Visual Studio when I open this document.
I've also found that, when this occurs, the Dispose() method is not called on my add-in button.
Any idea why this is happening?