<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Unable to use .mpk in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-use-mpk/m-p/696876#M8822</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working on 10.2.7 .net WPF with .mpk files from official samples and created on my own, I got the exception when calling localMapService.StartAsync(). &amp;nbsp;The message shows "&lt;SPAN style="color: #ff0000;"&gt;null class esri_runtimecore::Map_renderer::Symbol handle passed to interop function.&lt;/SPAN&gt;" &amp;nbsp;Have any idea how to fix this? &amp;nbsp;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Tue, 30 Aug 2016 12:47:10 GMT</pubDate>
    <dc:creator>WayneChen</dc:creator>
    <dc:date>2016-08-30T12:47:10Z</dc:date>
    <item>
      <title>Unable to use .mpk</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-use-mpk/m-p/696876#M8822</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Working on 10.2.7 .net WPF with .mpk files from official samples and created on my own, I got the exception when calling localMapService.StartAsync(). &amp;nbsp;The message shows "&lt;SPAN style="color: #ff0000;"&gt;null class esri_runtimecore::Map_renderer::Symbol handle passed to interop function.&lt;/SPAN&gt;" &amp;nbsp;Have any idea how to fix this? &amp;nbsp;Thanks a lot.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 12:47:10 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-use-mpk/m-p/696876#M8822</guid>
      <dc:creator>WayneChen</dc:creator>
      <dc:date>2016-08-30T12:47:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use .mpk</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-use-mpk/m-p/696877#M8823</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Hi Wayne. I guess you are using runtime sdk for .Net 10.2.7 since&amp;nbsp;ArcGIS Runtime SDK 10.2.5 for WPF was&amp;nbsp;the final release of this SDK. I understand that you are trying to load a map package and you get exception at&amp;nbsp;localMapService.StartAsync() method. The below code should work for you:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;using Esri.ArcGISRuntime.Controls;&lt;BR /&gt;using System;&lt;BR /&gt;using System.Diagnostics;&lt;BR /&gt;using System.Linq;&lt;BR /&gt;using System.Windows;&lt;BR /&gt;using Esri.ArcGISRuntime.Layers;&lt;BR /&gt;using Esri.ArcGISRuntime.LocalServices;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;namespace ArcGISApp1&lt;BR /&gt;{&lt;BR /&gt; public partial class MainWindow : Window&lt;BR /&gt; {&lt;BR /&gt; public MainWindow()&lt;BR /&gt; {&lt;BR /&gt; &lt;BR /&gt; &lt;BR /&gt; CreateLocalServiceAndDynamicLayer();&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;private void MyMapView_LayerLoaded(object sender, LayerLoadedEventArgs e)&lt;BR /&gt; {&lt;BR /&gt; if (e.LoadError == null)&lt;BR /&gt; return;&lt;/P&gt;&lt;P&gt;Debug.WriteLine(string.Format("Error while loading layer : {0} - {1}", e.Layer.ID, e.LoadError.Message));&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;public async void CreateLocalServiceAndDynamicLayer() &lt;BR /&gt; {&lt;BR /&gt; try&lt;BR /&gt; {&lt;BR /&gt; LocalMapService localMapService = new LocalMapService(@"D:\Cases\2016\February\Chris\abc.mpk");&lt;BR /&gt; await localMapService.StartAsync();&lt;/P&gt;&lt;P&gt;ArcGISDynamicMapServiceLayer arcGISDynamicMapServiceLayer = new ArcGISDynamicMapServiceLayer() &lt;BR /&gt; {&lt;BR /&gt; ID = "arcGISDynamicMapServiceLayer",&lt;BR /&gt; ServiceUri = localMapService.UrlMapService,&lt;BR /&gt; };&lt;/P&gt;&lt;P&gt;MyMapView.Map.Layers.Add(arcGISDynamicMapServiceLayer);&lt;BR /&gt; }&lt;BR /&gt; catch (Exception ex)&lt;BR /&gt; {&lt;BR /&gt; MessageBox.Show(ex.Message);&lt;BR /&gt; }&lt;BR /&gt; }&lt;/P&gt;&lt;P&gt;}&lt;BR /&gt;}&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 30 Aug 2016 19:45:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-use-mpk/m-p/696877#M8823</guid>
      <dc:creator>PrashantPurohit</dc:creator>
      <dc:date>2016-08-30T19:45:53Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use .mpk</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-use-mpk/m-p/696878#M8824</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks to&amp;nbsp;&lt;A _jive_internal="true" data-userid="149859" data-username="PPurohit-esristaff" href="https://community.esri.com/people/PPurohit-esristaff" style="color: #8ca9cd; background-color: #ffffff; border: 0px; font-weight: 200; font-size: 1.286rem;"&gt;Prashant Purohit&lt;/A&gt;&lt;SPAN style="background-color: #ffffff; color: #a9a9a9;"&gt;,&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d;"&gt;I also figure out that declaring &lt;SPAN style="color: #ff0000;"&gt;&amp;lt;esri:GISDynamicMapServiceLayer Name="myLayer"/&amp;gt; in xaml&lt;/SPAN&gt; and &lt;SPAN style="color: #ff0000;"&gt;myLayer.ServiceUri = localMapService.UrlMapService in&amp;nbsp;c# code&lt;/SPAN&gt; won't work even though the localserver is running.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN style="background-color: #ffffff; color: #3d3d3d;"&gt;Conclusion: following Prashant Purohit's code(same as the official demo sample), dynamically creating&amp;nbsp;a LocalMapService and GISDynamicMapServiceLayer in code is the right way.&lt;/SPAN&gt;&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Sep 2016 08:41:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/unable-to-use-mpk/m-p/696878#M8824</guid>
      <dc:creator>WayneChen</dc:creator>
      <dc:date>2016-09-01T08:41:53Z</dc:date>
    </item>
  </channel>
</rss>

