I have an offline device running a WPF app using VectorTileCache to add ArcGISVectorTiledLayer to the app's map. VectorTileCache loads a .vtpk file from the device's disk.
I have built capability to download a new version of the .vtpk file from a remote source and I would like to reload the ArcGISVectorTiledLayer when the new file is ready.
When I try to replace the old vtpk with the new one, I get an error that the file is in use:
System.IO.IOException: 'The process cannot access the file 'C:\temp\GeocacheKystVector.vtpk' because it is being used by another process.'
The ArcGISVectorTiledLayer that refers the vtpk is an item in Basemap.BaseLayers. I remove the item, run GC, but still get that IOException.
How do I unload the package?