<?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 Re: Release File After MobileMapPackage OpenAsync in .NET Maps SDK Questions</title>
    <link>https://community.esri.com/t5/net-maps-sdk-questions/release-file-after-mobilemappackage-openasync/m-p/693513#M8776</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at how I've released the references to the mmpk to be able to delete it in the Offline Mapbook example app:&amp;nbsp;&lt;/P&gt;&lt;PRE style="color: #24292e;"&gt;&lt;A href="https://github.com/Esri/mapbook-wpf/blob/4d58ce6e7bb7b6c0308cdc59ea445c6e8e931503/OfflineMapBook/OfflineMapBook/ViewModels/MainViewModel.cs#L91"&gt;https://github.com/Esri/mapbook-wpf/blob/4d58ce6e7bb7b6c0308cdc59ea445c6e8e931503/OfflineMapBook/OfflineMapBook/ViewModels/MainViewModel.cs#L91&lt;/A&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Thu, 09 Aug 2018 23:56:49 GMT</pubDate>
    <dc:creator>MaraStoica4</dc:creator>
    <dc:date>2018-08-09T23:56:49Z</dc:date>
    <item>
      <title>Release File After MobileMapPackage OpenAsync</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/release-file-after-mobilemappackage-openasync/m-p/693512#M8775</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;I am using ArcGIS Runtime SDK 100.3 in UWP. I am using it to open a mobile map package, i.e.&amp;nbsp;Esri.ArcGISRuntime.Mapping.MobileMapPackage.OpenAsync&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;There doesn't seem to be a way to delete the file once it goes out of scope. So, if I open it, load the map, display the map, remove the map, return from the method that used it (variables out of scope), then try to delete the file that was just used, I get a "file in use" exception. The map is completely out of scope, no layers are being used anywhere.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Is there a way to force the MobileMapPackage class to release the handle it has on a file without having to close the entire application? Sometimes we pull an mmpk into our application space for temporary use, open it, and then need to clean it up. To be clear, I am not looking to close the file while the map/layers are still in use/accessing local data.&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 22:48:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/release-file-after-mobilemappackage-openasync/m-p/693512#M8775</guid>
      <dc:creator>StephenDavis1</dc:creator>
      <dc:date>2018-08-09T22:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: Release File After MobileMapPackage OpenAsync</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/release-file-after-mobilemappackage-openasync/m-p/693513#M8776</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Take a look at how I've released the references to the mmpk to be able to delete it in the Offline Mapbook example app:&amp;nbsp;&lt;/P&gt;&lt;PRE style="color: #24292e;"&gt;&lt;A href="https://github.com/Esri/mapbook-wpf/blob/4d58ce6e7bb7b6c0308cdc59ea445c6e8e931503/OfflineMapBook/OfflineMapBook/ViewModels/MainViewModel.cs#L91"&gt;https://github.com/Esri/mapbook-wpf/blob/4d58ce6e7bb7b6c0308cdc59ea445c6e8e931503/OfflineMapBook/OfflineMapBook/ViewModels/MainViewModel.cs#L91&lt;/A&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 09 Aug 2018 23:56:49 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/release-file-after-mobilemappackage-openasync/m-p/693513#M8776</guid>
      <dc:creator>MaraStoica4</dc:creator>
      <dc:date>2018-08-09T23:56:49Z</dc:date>
    </item>
    <item>
      <title>Re: Release File After MobileMapPackage OpenAsync</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/release-file-after-mobilemappackage-openasync/m-p/693514#M8777</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Thanks for your example, that worked for me. Is there something similar for offline Vector Tiled Layers (vtpk)? I am also having trouble releasing the resources for those and deleting the files.&lt;/P&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 18 Aug 2018 15:02:59 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/release-file-after-mobilemappackage-openasync/m-p/693514#M8777</guid>
      <dc:creator>StephenDavis1</dc:creator>
      <dc:date>2018-08-18T15:02:59Z</dc:date>
    </item>
    <item>
      <title>Re: Release File After MobileMapPackage OpenAsync</title>
      <link>https://community.esri.com/t5/net-maps-sdk-questions/release-file-after-mobilemappackage-openasync/m-p/693515#M8778</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;P&gt;Try removing the vtpk layers from the map.&amp;nbsp;This worked for me:&lt;/P&gt;&lt;P&gt;&lt;/P&gt;&lt;PRE class="lia-code-sample line-numbers language-none"&gt;&lt;CODE&gt;&lt;SPAN class="comment token"&gt;// set basemap to null and force garbage collection to release vector tiles&lt;/SPAN&gt;
map&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;Basemap &lt;SPAN class="operator token"&gt;=&lt;/SPAN&gt; &lt;SPAN class="keyword token"&gt;null&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
GC&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;Collect&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;
GC&lt;SPAN class="punctuation token"&gt;.&lt;/SPAN&gt;&lt;SPAN class="token function"&gt;WaitForPendingFinalizers&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;(&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;)&lt;/SPAN&gt;&lt;SPAN class="punctuation token"&gt;;&lt;/SPAN&gt;‍‍‍‍&lt;SPAN class="line-numbers-rows"&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;SPAN&gt;‍&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/CODE&gt;&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 12 Dec 2021 05:11:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/net-maps-sdk-questions/release-file-after-mobilemappackage-openasync/m-p/693515#M8778</guid>
      <dc:creator>MaraStoica4</dc:creator>
      <dc:date>2021-12-12T05:11:15Z</dc:date>
    </item>
  </channel>
</rss>

