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.
  • 4
    What kind of error message are you getting? Could you provide more information? – Jason Scheirer Apr 20 '14 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? – Michael Stimson Apr 21 '14 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 – Gunner Apr 21 '14 at 3:34
  • @JasonScheirer I have added few error message – Gunner Apr 21 '14 at 9:26
  • @MichaelMiles-Stimson I am getting these error at compile time and these are addin type of application. – Gunner Apr 21 '14 at 9:28

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".

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.