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.
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?
Windows 10, VS2019
Solved! Go to Solution.
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
did you mean the basemap not showing up?
Uncomment below line to use basemap:
//Map = new Map(BasemapStyle.ArcGISTopographic);
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
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/
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
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