2

I was going through ArcObjects example on following linkWalkthrough_Building_custom_UI_elements .I followed same steps but I was getting error while initializing objects for following code.

ESRI.ArcGIS.Display.IRubberBand rubberBand = new ESRI.ArcGIS.Display.RubberLineClass()
ISimpleMarkerSymbol simpleMarkerSymbol = new ESRI.ArcGIS.Display.SimpleMarkerSymbolClass()
IMarkerElement markerElement = new MarkerElementClass()

etc I was not able to find exact reason why I was getting but may be due to version of ArcObjects.I am using .Net 4.0,Visual studio 2010, ArcObjects 10.2. I got following type of error

The type 'ESRI.ArcGIS.Display.RubberLineClass' has no constructors defined.
Interop type 'ESRI.ArcGIS.Display.SimpleMarkerSymbolClass' cannot be embedded. Use the applicable interface instead.
asked Apr 20, 2014 at 17:26
5
  • 4
    What kind of error message are you getting? Could you provide more information? Commented Apr 20, 2014 at 18:08
  • Are you trying to run this as an add-in or a standalone application? Have you referenced your assemblies, both with assembly reference and imports? Commented Apr 21, 2014 at 3:18
  • Error Message like these The type 'ESRI.ArcGIS.Display.RubberLineClass' has no constructors defined Interop type 'ESRI.ArcGIS.Display.SimpleMarkerSymbolClass' cannot be embedded. Use the applicable interface instead Commented Apr 21, 2014 at 3:34
  • @JasonScheirer I have added few error message Commented Apr 21, 2014 at 9:26
  • @MichaelMiles-Stimson I am getting these error at compile time and these are addin type of application. Commented Apr 21, 2014 at 9:28

2 Answers 2

4

I had this problem in Visual Studio 2010, when you included your error message it came back to me. The answer can be found here : https://stackoverflow.com/questions/2483659/interop-type-cannot-be-embedded.

Extract of:

For whatever reason, this assembly can't be embedded - but it sounds like that's not a problem for you. Just open the Properties tab for the assembly in Visual Studio 2010 and set "Embed Interop Types" to "False".

answered Apr 21, 2014 at 22:02
0

Same type of problem comes when use AoInitializeClass

Interop type 'AoInitializeClass' cannot be embedded. Use the applicable interface instead.

for solve issue use following steps.

  1. Goo to in Solution Explorer.

  2. Right click on project Properties.

  3. Change References ESRI.ArcGIS.System set 'Embed Interop Types' to 'false'

answered Mar 15, 2022 at 10:28

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.