I was trying to attach a debugger to an Outlook plugin I was working on. It was originally written for Outlook 2003, but has been progressively upgraded to 2010. However, I couldn’t breakpoint my code, or rather, the breakpoints weren’t being hit.
Found the answer on Stack Overflow:
So it turns out that Outlook doesn’t load the CLR on startup (it must be loaded shortly thereafter when it becomes necessary), which apparently confuses the VS debugger and causes it to only debug native code. To force it to load the CLR immediately, create an OUTLOOK.EXE.config file in the same folder with:
<configuration> <startup> <supportedRuntime version="v2.0.50727"/> </startup></configuration>
which is from this blog post. Then, even when VS starts attached, it will debug CLR code