AnsweredAssumed Answered

Heisenbug importing Shapefiles

Question asked by xtian79 on Apr 28, 2014
Latest reply on May 27, 2014 by MBranscomb-esristaff
DEAR PEOPLE FROM THE FUTURE: Here's what we've figured out so far???

I checked the example that is posted in [HTML]http://www.arcgis.com/home/item.html?id=953a530ada30477d95cc69e788268bc9[/HTML] and successfully tried to reproduce it in a new application, it works smothly. Then I proceed to implement it in a robust application that use MVVM pattern under PRIMS framework, I copied and pasted the code in the applicaction, but when the code tries to get the details from the feature layer to create the renderer, it fails...it comes with an exception

                             arcGisLocalDynamicMapServiceLayer.GetDetails(dynamicLayerInfo.ID, (featureLayerInfo, exception) =>                                                         {                                 switch (featureLayerInfo.GeometryType)                                 {                                     case ESRI.ArcGIS.Client.Tasks.GeometryType.Envelope:                                         layerDrawOpt.Renderer = new SimpleRenderer() { Symbol = new SimpleFillSymbol() { Fill = new SolidColorBrush(GetRandomColor()), BorderBrush = new SolidColorBrush(GetRandomColor()) } };                                         break;                                     case ESRI.ArcGIS.Client.Tasks.GeometryType.MultiPoint:                                         layerDrawOpt.Renderer = new SimpleRenderer() { Symbol = new SimpleMarkerSymbol() { Color = new SolidColorBrush(GetRandomColor()), Size = 8 } };                                         break;                                     case ESRI.ArcGIS.Client.Tasks.GeometryType.Point:                                         layerDrawOpt.Renderer = new SimpleRenderer() { Symbol = new SimpleMarkerSymbol() { Color = new SolidColorBrush(GetRandomColor()), Size = 8 } };                                         break;                                     case ESRI.ArcGIS.Client.Tasks.GeometryType.Polygon:                                         layerDrawOpt.Renderer = new SimpleRenderer() { Symbol = new SimpleFillSymbol() { Fill = new SolidColorBrush(GetRandomColor()), BorderBrush = new SolidColorBrush(GetRandomColor()) } };                                         break;                                     case ESRI.ArcGIS.Client.Tasks.GeometryType.Polyline:                                         layerDrawOpt.Renderer = new SimpleRenderer() { Symbol = new SimpleLineSymbol() { Color = new SolidColorBrush(GetRandomColor()) } };                                         break;                                     default:                                         break;                                 }                                 // Set the LayerDrawingOptions property on the local dynamic map service layer (the LayerID property ties this to the DynamicLayerInfo object).                                 layerDrawingOptionsCollection.Add(layerDrawOpt);                                  // Refresh the dynamic map service layer to render the result of the datasource/layer change.                                 arcGisLocalDynamicMapServiceLayer.Refresh();                             });


The object featureLayerInfo is null, I check the local ArcGIS server, and it is present with the map service, and the exception states : "Unable to find the specified 'dataSourceName' in 'dataSource' for dynamic dataLayer with 'id': 0."


I dont know what to check for, I have been debugging side-by-side the code of both applications, and one of them works but the other one fails (I use two different shapefiles in the process, and I have change between them in the apps with the same result).

Outcomes