AnsweredAssumed Answered

Carto vs. Display - IFeatureLayer

Question asked by deleted-user-VeC5jUIlNXtq on Mar 13, 2013
Latest reply on Mar 14, 2013 by deleted-user-VeC5jUIlNXtq

Quick info: VS2010 Express, developing using against the .NET 4.0 for ArcGIS 10.1 SP1

I haven't found an exact solution to my issue, just some similar issues.

Long story short I've got the following lines of code:

        Dim pTemplateLayer As IFeatureLayer
        pTemplateLayer = New FeatureLayer

When I go to the References of my project and select "Unused References..." it brings up ESRI.ArcGIS.Display, so I decide to remove as I have been doing with all other projects.

It brings up an error saying "Implementing class 'ESRI.ArcGIS.Carto.FeatureLayerClass' for interface 'ESRI.ArcGIS.Carto.FeatureLayer' cannot be found."

I re-add the Display reference and all is well. Interestingly, if I remove the reference to Display and change the " = New FeatureLayer" to " = New FeatureLayerClass" I'm asked to reference Display.

Could somebody give me a quick explanation of this behavior? Why is Display being thought of as an Unused Reference by Visual Studio, but required at the same time?