Despite the gloomy picture painted for COM add-ins being loaded by mscoree.dll, a solution resolves these three problems. The solution involves writing a custom CLR host DLL called a shim DLL (written in C++) to be the loader for the CLR and the COM add-in instead of relying on mscoree.dll. A new shim DLL must be created for each COM add-in you are going to deploy. Using a shim DLL leads to a number of advantages:
If you are building a managed COM add-in for Outlook 2003, consider using the new VSTO Outlook Addin project. Building an add-in in this way resolves the problems with mscoree.dll, as well as some other Outlookspecific issues with add-ins described in Chapter 24, "Creating Outlook AddIns with VSTO." Microsoft has provided a Visual Studio COM add-in shim wizard project that works with Visual Studio 2003. It is available at http://msdn.microsoft.com/office/default.aspx?pull=/library/enus/dno2k3ta/html/ODC_Office_COM_Shim_Wizards.asp. At the time this book was written, no wizards were available for Visual Studio 2005. You can use the C++ COM shim project generated by this wizard in Visual Studio 2003, however, and import it into Visual Studio 2005. |