10.4 upgrade error - "event invocation for COM objects requires event to be attributed with DispIDAttribute”

4709
6
04-21-2016 07:15 AM
DaleShearer
Occasional Contributor

Thank you for looking at my question.  I have upgraded to 10.4, re-built my applications in VS2013.  At which time I was not getting the esriAddIns created.  With help from a prior question I did the following:

I went to my Program Files (x86)\MSBuild\Esri and the AddIns.target file is ESRI.ArcGIS.AddIns.target.  In the VBPROJ file (from 10.3) it was ESRI.ArcGIS.AddIns.11.target. I removed the .11 from the three references and made sure
the CSPROJ file was updating which it was.

I also found that the AddInTargetVersion was set to
10.3.  I changed it to 10.4

<AddInTargetVersion>10.4</AddInTargetVersion>

Once I made the changes the esriAddIn file was created for each of my applications.

Now when I go to run the addins I get the following error messages.

“Application.OnStartup - event invocation for COM objects requires event to be attributed with DispIDAttribute”

“Object or Application that generated Error:  System.Core.”

I am working on trying to understand these messages, but if anyone can shed some light on these or point me in the right direction I would appreciate it.

Thanks, Dale

6 Replies
DaleShearer
Occasional Contributor

Now what I can determine is that I need to set the Embed Interop Types on the references to True.  I cannot find a way or where to do this VS2013.  So that is where I am currently at.

0 Kudos
DaleShearer
Occasional Contributor

I went through the Embed Interop Types on the references, some are set to true, others false, changing any of them does not help.

In going through the Output file I found:

Config.esriaddinx : warning : The file content is an invalid ESRI ArcGIS Add-in configuration xml.

So I am looking at that.

There has to be some documentation, something on all of this, I cannot see every user going through all this to upgrade to 10.4.

0 Kudos
DaleShearer
Occasional Contributor

After a lot of digging and looking on the internet and determining where it was error was occuring in my application, I figured out that the Embed Interop Types on the ESRI.ARCGIS.Carto reference was set to True and needed to be set to False.

Once I set it to False I no longer received the error.

What I found odd that when I set the Target Framework to .NET Framework 4.5 some of the references updated to version 10.4, while I had to go in and remove and then re-add the other references.

On the other references, the Embed Interop Types, some are set to True, some are set to false.

deleted-user-msNS7us4vPAx
New Contributor

Many thanks, Dale Shearer. This also worked for me, changing this assembly from True to False fixed the  error. Thank you, thank you, thank you. I did not have to mess with the properties of any other references.

Per_TerjeMortensen
New Contributor

Thx Dale. I've started the migration from ArcGIS 10.2.1 / Visual Studio VB.NET 2010 to ArcGIS 10.4.1 and VS2013. I got the same error, but your post saved my day. I set Embed Interop Types for all the assemblies to False and the error go away

AmitaNarote
New Contributor II

Thanks a lot Dale,

This has worked for me to migrate ArcObjects Desktop code migration from 10.1 to 10.5.1 with VS2015.

I set all Referenced assemblies property ' Embed Interop Types' = False on properties window ; and it removed all errors  - "Additional information: event invocation for COM objects requires event to be attributed with DispIdAttribute"

-Amita.

0 Kudos