UWP: Shared Folders
You can define a folder (or folders) in an app that can also be used by other apps from the same publisher and which also know about that folder. Learn more here.
Join the DZone community and get the full member experience.Join For Free
All this month, I'm taking some time each day to explore (and document) things that are related to UWP development that I haven't fully investigated or used before. While doing it over lunch each day I'm calling it #UWPLunch.
This feature has been around as long as Windows 10. I've just never used it.
You can define a folder (or folders) in an app that can also be used by other apps from the same publisher and which also know about that folder.
Be careful of copying from the docs on this topic as they contain two errors in the sample XML.
The element name is PublisherCacheFolders (with an 's') and the Folder elements must be closed.
<Extensions> <Extension Category="windows.publisherCacheFolders"> <PublisherCacheFolders> <Folder Name="Config" /> </PublisherCacheFolders> </Extension> </Extensions>
Just add the above to Package.AppxManifest for each project.
You can then access this folder from all projects with:
StorageFolder configFolder = ApplicationData.Current.GetPublisherCacheFolder("Config");
Published at DZone with permission of Matt Lacey, DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.