I made some changes to my code a couple of weeks ago and didn’t document them for myself, nor did I try to debug the code for a week or so. So by the time I did try it out, I didn’t remember what I’ve done, and of course there’s some reason the add-in isn’t loading anymore. It’s still listed among the 14 add-ins listed as “Loading Add-ins” as Outlook starts up, but the context menu isn’t available where it should be anymore.
Digging deep into Outlook 2010 to see what goes on with the add-in (Outlook File menu > Options > Add-Ins > COM Add-ins Go… button > click on the add-in in the list), the Load Behavior text says the following:
Not loaded. A runtime error occurred during the loading of the COM Add-in.
Google that error message, a few articles come back, and I bookmarked a couple to check on later. I’ve reviewed them and tried the following:
http://blogs.msdn.com/b/vsod/archive/2008/04/22/troubleshooting-com-add-in-load-failures.aspx
- Examined Registry entry (HKCU\…\Outlook\Addins\) to confirm two things:
- LoadBehaviour setting is still = 3 (it is)
- file path listed in Manifest value is still valid (it is)
- Ensured add-in isn’t on the Disabled list (it isn’t)
- Ran Dbgview.exe while loading Outlook to see if there are any obvious errors being thrown that aren’t otherwise being noticed (there aren’t any entries remotely related to my add-in)
http://social.msdn.microsoft.com/forums/en-US/vsto/thread/f2f2a8f6-3ed5-4c1f-ab6b-17120e64f13d/
- Set the VSTO_SUPPRESSDISPLAYALERTS=0
- Observed the following error:
- Microsoft Office Application Add-In
An add-in could not be found or could not be loaded. - Details button:
Exception from HRESULT: 0x8004063E
- Found a bunch of discussions referencing this error, and started with the first result: http://social.msdn.microsoft.com/Forums/en-US/vsto/thread/d0ffb791-43bb-41f3-a2ca-c22bd959f4c3
- Per instructions, I shut down Outlook, started VS2010, chose “Clean [project]” from the Build menu – this seems to have removed the HKCU registry entry for the add-in
************** Exception Text **************
System.Runtime.InteropServices.COMException (0x8004063E): Exception from HRESULT: 0x8004063E
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)
at System.Runtime.InteropServices.Marshal.ThrowExceptionForHR(Int32 errorCode, IntPtr errorInfo)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.CreateCustomizationDomainInternal(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)
at Microsoft.VisualStudio.Tools.Office.Runtime.DomainCreator.Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IDomainCreator.CreateCustomizationDomain(String solutionLocation, String manifestName, String documentName, Boolean showUIDuringDeployment, IntPtr hostServiceProvider, IntPtr& executor)
Worked like a charm – next time I debugged the add-in, it came up exactly as I expected it to.
Additional Reference
Debugging in Application-Level Projects http://msdn.microsoft.com/en-us/library/ms269003.aspx