Select to view content in your preferred language

LocalServer stopped rendering

737
5
Jump to solution
06-22-2023 04:29 PM
PhilBastian
New Contributor II

I followed the tutorial for setting up a WPF map project from https://developers.arcgis.com/net/maps-2d/tutorials/display-a-map/, except using .NET Framework and replacing the reference to the basemap with loading a LocalService 

        private void SetupMap()
        {
            // Create a new map with a 'topographic vector' basemap.
            //Map = new Map(BasemapStyle.ArcGISTopographic);
            Map = new Map();
            var layerService = new LocalMapService(@"C:\temp\MMIS_BaseMap.mpkx");
            layerService.StartAsync().ContinueWith((_) =>
            {
                var layer = new ArcGISMapImageLayer(layerService.Url);
                //Map.Basemap = new Basemap(layer);
                Map.OperationalLayers.Add(layer);
            });
        }

 

This was all working great, but suddenly the local service stopped rendering, or rather it's only rendering a blank canvas, and I can't work out why.

PhilBastian_0-1687476044696.pngPhilBastian_1-1687476161930.png

any ideas why? Potentially related is this error in the xaml? I have the ArcGIS Runtime Local Server SDK installed, but there doesn't appear to be any SDK installation that would put a runtime folder in the visual studio folder?

PhilBastian_3-1687476335645.png

Windows 10, VS2019

 

0 Kudos
1 Solution

Accepted Solutions
PhilBastian
New Contributor II

I have solved the issue: LocalServer.Instance.AppDataPath was the default location (my user appdata temp folder). My organisation uses roaming profiles and another machine I logged into had an older version of ArcGIS runtime installed, which must have put something into this folder which was incompatible with the latest version. Setting LocalServer.Instance.AppDataPath to a path specific for my app has allowed the layer to render again

View solution in original post

5 Replies
ParhatM
New Contributor II

did you mean the basemap not showing up?

Uncomment below line to use basemap:

//Map = new Map(BasemapStyle.ArcGISTopographic);

 

0 Kudos
PhilBastian
New Contributor II

no, i commented that out on purpose so that it was possible to see the issue. The issue is the layer served by the local map service is rendering as blank

0 Kudos
sjones_esriau
Esri Contributor

Hi Phil,

Might be a silly question, but did you check if the localserver is running?

You can check with LocalServer.Instance.Status or check and monitor the services with the sample: https://developers.arcgis.com/net/wpf/sample-code/local-server-services/

0 Kudos
PhilBastian
New Contributor II

Thanks: I have confirmed that LocalServer.Instance.Status is 'Started'. Also, the screenshot of Edge shows the map export request directly from the service rest endpoint

0 Kudos
PhilBastian
New Contributor II

I have solved the issue: LocalServer.Instance.AppDataPath was the default location (my user appdata temp folder). My organisation uses roaming profiles and another machine I logged into had an older version of ArcGIS runtime installed, which must have put something into this folder which was incompatible with the latest version. Setting LocalServer.Instance.AppDataPath to a path specific for my app has allowed the layer to render again