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:
<SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;">public</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">MainWindow</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">()
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">{</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">
</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">InitializeComponent</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">();
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">StartLocalServer</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">();</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">}</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">
</SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;">private</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">Esri</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">ArcGISRuntime</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">LocalServices</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">LocalServer</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> _localServer</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">;
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;">private</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> async </SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;">void</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">StartLocalServer</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">()
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">{</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">
_localServer </SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">=</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">Esri</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">ArcGISRuntime</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">LocalServices</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">LocalServer</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">Instance</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">;
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> await _localServer</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">StartAsync</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">();
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;">var</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> mapService </SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">=</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;">new</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">Esri</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">ArcGISRuntime</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">LocalServices</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">LocalMapService</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">(</SPAN><SPAN class="" style="color: #7d2727; border: 0px; font-weight: inherit; font-size: inherit;">@"C:\mappackage.mpk"</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">);
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> await mapService</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">StartAsync</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">();
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> </SPAN><SPAN class="" style="color: #101094; border: 0px; font-weight: inherit; font-size: inherit;">var</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> mapServiceUrl </SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">=</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;"> mapService</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">.</SPAN><SPAN class="" style="color: #2b91af; border: 0px; font-weight: inherit; font-size: inherit;">Url</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">;</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">
</SPAN><SPAN class="" style="color: #303336; border: 0px; font-weight: inherit; font-size: inherit;">}</SPAN>I checked the generated url of the local service and not a single layer in that map package was found. See the screenshot here:
The map package was created in ArcMap 10.5.1 with Runtime support enabled. It contains point layer, polyline layer, and polygon layer.
I am using Visual Studio 2012 in Windows 7 SP1.
Any help would be appreciated! Thank you!