0

I have a universal windows store project. I want to access shared files which are accessible by both windows 8.1 and wp 8.1.

StorageFolder storageFolder = Windows.Storage.ApplicationData.Current.LocalFolder;
StorageFile sampleFile = await storageFolder.GetFileAsync("text.txt");

I tried this but its not working. Location is wrong. Any idea what is the location of shared files ?

Tany3450
  • 338
  • 2
  • 11

1 Answers1

1

I think the term you're looking for is "roaming" rather than "shared".

If you want to share user data between the same app running on both Windows and Windows Phone then put the data in the ApplicationData.RoamingFolder. LocalFolder files are local to the current system. RoamingFolder files will roam across systems, including between the same app on Windows and Windows Phone.

See Guidelines for roaming app data and Accessing app data with the Windows Runtime

The "Shared" project is a compile time concept. Files in that project are merged with the platform specific projects at compile time. When building, Visual Studio uses all of the files from the target platform project plus all of the files in the Shared project and treats them as a single project. Content files in the Shared project will be included in the appx for both platforms and are available at runtime via the ms-appx: protocol or the Package.InstalledLocation folder.

Rob Caplan - MSFT
  • 21,714
  • 3
  • 32
  • 54