VSTO Error CS1760 stdole.dll

Feb 16 2018 9:46 AM

There is a VSTO Excel project:

I would like to send an email with outlook but clearly, some assemblies are missing:

So I decided to add a reference:

Adding the reference:

The Interop.Outlook appears in the References

As soon as I add a reference the Outlook keyword and other keywords are find:

Visual studio is not complaining about the Outlook keyword anymore.

However, Building the project produces the following error:

ErrorCS1760

Assemblies 'C:\WINDOWS\assembly\GAC\stdole\7.0.3300.0__b03f5f7f11d50a3a\stdole.dll' and 'C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\PublicAssemblies\stdole.dll' refer to the same metadata but only one is a linked reference (specified using /link option); consider removing one of the references.ExcelAddIn1C:\Users\lt5244\source\repos\ExcelAddIn1\ExcelAddIn1\CSC 1 Active

What should I do please?

Answer:

Looks closely at the References when there is no Outlook reference added:

There is just one stdole.dll

As soon as you add Microsoft.Outlook 15.0 reference there is a new stdole.dll added:

When you remove one or the other you get the “XYZ does not exist in the current namespace”


Answers (1)