Select to view content in your preferred language

Heisenbug importing Shapefiles

4818
12
Jump to solution
04-28-2014 06:20 AM
Cristian_Galindo
Frequent Contributor
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).
0 Kudos
12 Replies
Cristian_Galindo
Frequent Contributor
Hello Mike!!!

sorry my absence....i decide to take a small vacation from this problem in order to fix my ideas about it.

I'm trying to reproduce the behavior in a bootstraped application with MEF, but in it, the application works fine ....maybe the code of the other application is haunted.

I continue with my efforts to undertand the JSON messages.

I set up my visual studio to raise ANY exception,  but it only fires the one that state that it cannot found the datasource.

Why the Local Server does  not create log files, despite the fact that the coinfiguration is set to do it?
0 Kudos
Cristian_Galindo
Frequent Contributor
well....finally I solved the issue.

this is quite tricky:

App A: Works Fine

References to the dll in the program files folder.


App B: do not work

references to a third party references folder in TFS. build drop folder contains a Deploy folder created with the ArcGIS Runtime WPF Deployment Builder 10.2.2


Something that is not mentioned neither in the documentation of the example or in the documentation of the classes involved in the creation of a Dynamic layer is that you must select some items for a correct deployment.
My application was run from a folder with a deployment folder inside, so it instantiate a local server using the dll's and configuration specified for it (that was the reason i did'nt get any log file).

I was reading something for deployment task when I found what i was missing, so i rebuild a deployment folder including the Vector additional data format, also the logging feature.
the problem was solved.

Funny fact:
after replacing the folder the issue descriped here http://forums.arcgis.com/threads/109301-Legend-item-template-brings-a-huge-image....Why was fixed!!!! Why, How, i do not know.


Thanks a lot for your replies

P.S.

It is necessary an improvement in the documentation, really.
0 Kudos
MichaelBranscomb
Esri Frequent Contributor
Hi,

Glad to hear you resolved the issue you were experiencing - but sorry you found the doc inadequate regarding deployment options, I'll add a scrum task for enhancing the deployment doc.

To clarify - in order for the LocalServer to support Shapefiles added via the DynamicLayer capability you need to use the Deployment Builder tool to create a deployment which includes the LocalServer with 'Additional Data formats > Vector'.

Cheers

Mike
0 Kudos