A new installment of the series of articles that I am devoting to building add-ins for the VBA editor of Microsoft Office using the .NET Framework and Visual Studio, this time related to debugging:
HOWTO: Debug an add-in for the VBA editor (32-bit or 64-bit) of Office with Visual Studio .NET.
While it may seem pretty straightforward, it is a bit tricky to set it right, specially if you are using Visual Studio 2010 (that can use two CLRs, 2.0 and 4.0) and you use the lower one (CLR 2.0). It happens that VS 2010 can have one behavior and VS 2010 with SP1 another one (resulting in debugging or not debugging at all). SP1 introduced this problem to Visual Studio add-ins too, and after I reported it to Microsoft through Microsoft Connect here, they released the hot fix http://support.microsoft.com/kb/2591546, which however “We do not recommend that you install this hotfix if you use Visual Studio to create Office add-in projects.“.
Fortunately the article shows three different procedures to debug Office add-ins that work around these problems.