I'm trying to write an Outlook Addin in C# using Visual Studio 2010 and WPF and it's turning out to be difficult to debug. I would like to have VS automatically attach to OUTLOOK.EXE upon startup so that I can hit breakpoints easily. So, I went into the project's properties > Debug tab > Start Action and changed this setting from "Start project" (which of course won't work because it's a DLL) to "Start external program."
This seems to work; Outlook starts and clearly the debugger is attached. However, no breakpoints are hit. I noticed that when I go into the "Attach to Process" dialog it says that Outlook is only running x86 (which I think is incorrect because my manged code is running in that address space -- right?), so in the Debug tab of the Settings panel I clicked "Enable unmanaged code debugging," and now I'm out of ideas. I also can't pause the process because I get an error telling me that the process isn't running the type of code I selected to debug. I know my Addin is definitely loaded and executing because I can see it working.
As a workaround I've been using System.Diagnostics.Debugger.Launch(), which is annoying, but it works. Any ideas?