Cannot load map package using ArcGIS Runtime .Net for WPF local service

666 views Asked by At

I am trying to load a local map package to the main window using ArcGIS Runtime .Net for WPF (Version 100.1). But somehow the local server cannot find layers in the map package. Here's my script:

        public MainWindow()
    {
        InitializeComponent();
        StartLocalServer();
    }

    private Esri.ArcGISRuntime.LocalServices.LocalServer _localServer;

    private async void StartLocalServer()
    {            
       _localServer = Esri.ArcGISRuntime.LocalServices.LocalServer.Instance;
        await _localServer.StartAsync();
        var mapService = new Esri.ArcGISRuntime.LocalServices.LocalMapService(@"C:\mappackage.mpk");
        await mapService.StartAsync();
        var mapServiceUrl = mapService.Url;

    }

I checked the generated url of the local service and not a single layer in that map package was found. See the screenshot here: screenshot of local service The map package was created in ArcMap 10.5 with Runtime support enabled. It contains 2 point layers, 2 polyline layers, and 1 polygon layer.

Any help would be appreciated! Thank you!

2

There are 2 answers

3
dotMorten On

v100.1's local server doesn't support MMPKs created with 10.5. You need 10.5.1 to create packages compatible with the 100.1 local server.

From https://developers.arcgis.com/net/latest/wpf/guide/system-requirements.htm:

  • ArcGIS Pro: To create mobile map packages for use in your ArcGIS Runtime apps use ArcGIS Pro 1.3 or higher.
  • ArcGIS Desktop: To create geoprocessing packages and map packages for ArcGIS Runtime Local Server 100.1.0 use ArcGIS Desktop 10.5.1.
0
TTTZ On

The Local Server deployment created automatically contains only minimum resources required by default. If the map package contains shapefiles, raster data, etc, it needs to be specified in additional deployment options in the deployment config file.