Monday, June 2, 2014

MS Office Add-in development: Enable "Embed Interop Types".

Warning    1    A reference was created to embedded interop assembly 'c:\Program Files\Reference Assemblies\Microsoft\VSTO40\v4.0.Framework\Microsoft.Office.Tools.Common.dll' because of an indirect reference to that assembly created by assembly 'c:\Program Files\Reference Assemblies\Microsoft\VSTO40\v4.0.Framework\Microsoft.Office.Tools.Word.dll'. Consider changing the 'Embed Interop Types' property on either assembly.

Developers get this is common warning during developing add-in for Microsoft Office. Because the type equivalence feature is not enabled by default in a office project. To enable this feature go to properties of
-- Microsoft.Office.Tools.Common 
-- Microsoft.Office.Tools
-- Microsoft.Office.Tools.Word 
-- Microsoft.Office.Tools.Excel  
-- Microsoft.Office.Tools.Outlook - references and 
set "True" to "Embed Interop Types" property.

The type equivalence feature, embeds type information to the office solution. And enables the version independence at run time