I am facing lots of issues about this bug.
'The FeatureSource is not open. Please call the Open method before calling this method.'
Whenever using any feature source methods, i am making layer open and also feature source open.
Even though, some of the times it's raising this bug. I debug it clearly, in some of the times if we execute layer.featuresource.open() method then layer is opened but feature source is not opened. i think that's why only it's raising this bug.
I am not sure when it's happening because if we check one more time on that time, layer and feature source both are opened by calling open method.
Can you clearly explain me, How to handle this bug.
Mostly i am using InMemoryFeatureLayer and ShapeFileFeatureLayer feature source methods.
ShapeFileFeatureLayer _shpATSPoints = new ShapeFileFeatureLayer("path\Shape.shp");
List features = _shpATSPoints.FeatureSource.SpatialQuery().ToList();
InMemoryFeatureLayer imAircraftLayer = (InMemoryFeatureLayer)((LayerOverlay)wfMap.CustomOverlays["AircraftOverlay"]).Layers["Layer1"];
fts_SelectedAircrafts = imAircraftLayer.FeatureSource.GetFeaturesWithinDistanceOf(e.Position, wfMap.MapUnit, DistanceUnit.NauticalMile, _dAircraftMouseClickDistance, ReturningColumnsType.AllColumns).ToList();
Note: is layer needs to lock then only we can use it.