This project has moved. For the latest updates, please go here.

Registering com object

Jan 4, 2016 at 10:22 AM
Many thanks Sebastian for your software. I have already created 2 working addins which are very useful. I have a question about registering the dlls.

On one machine which has VS installed, I can check the "Register for COM interop", and the Outlook addin loads with no problems. This machine is windows 10 64 bit, Outlook 2010 64 bit.

On another machine which has VS installed, I can check the "Register for COM interop", and the Outlook addin loads with no problems. This machine is windows 10 64 bit, Outlook 2010 32 bit. However on this machine I get the following errors and warnings.

I can see this is caused by calling regasm with /tlb. If I call regasm without /tlb the error does not appear. Either way the addin loads and works well. My questions is do we need the /tlb option?

Error
The assembly "C:\programming\netoffice addin tests\OutAddin2\OutAddin2\bin\Debug\OutAddin2.dll" could not be converted to a type library. Type library exporter encountered an error while processing 'OutAddin2.Addin, OutAddin2'. Error: Referenced type is defined in managed component, which is imported from a type library that could not be loaded (type: 'NetOffice.OfficeApi.IRibbonExtensibility'; component: 'C:\programming\netoffice addin tests\OutAddin2\OutAddin2\bin\Debug\OfficeApi.dll').

Warning
Type library exporter warning: Referenced type is defined in managed component, which is imported from a type library that could not be loaded because it was not registered (type: 'NetOffice.OutlookApi.Tools.COMAddin'; component: 'C:\programming\netoffice addin tests\OutAddin2\OutAddin2\bin\Debug\OutlookApi.dll').
Coordinator
Jan 4, 2016 at 12:15 PM
You dont need the /tlb option. This means creating a type library you can use for development to combine early/late binding as well.

The common compiler/regasm strategy is to register your addin and all dependencies there have COM types/interfaces included.
In order prevent this for NetOffice assemblies each .dll has the PrimaryInteropAssemblyAttribute in AssemblyInfo.cs.
(a negative side effect is, VS set the reference option "Embed Interop Types" to true by default - i still figure out how i can disable this VS 'feature')

*Sebastian
Jan 4, 2016 at 12:49 PM
Thank you for this information. Very helpful. I am removing the "Embed Interop Types" in the properties.
Michael