Note that there are some explanatory texts on larger screens.

plurals
  1. POAccessing files from "shared/transfers" using a URI does not work for a WP8 app anymore
    primarykey
    data
    text
    <p>I have a WP7 application that I run successfully on both WP7 and WP8 devices. In the app I download audio files using the <code>BackgroundFileTransfer</code> service and store the files to the <code>shared/transfers</code> folder. I then create <code>AudioTrack</code>s by giving a URI to the downloaded file locations.</p> <pre class="lang-cs prettyprint-override"><code> Uri episodeLocation; try { using (IsolatedStorageFile iso = IsolatedStorageFile.GetUserStoreForApplication()) { Debug.WriteLine(" *** Creating track, file exists: " + iso.FileExists("shared/transfers/song.mp3")); } episodeLocation = new Uri("shared/transfers/song.mp3", UriKind.Relative); } catch(Exception) { return null; } return new AudioTrack(episodeLocation, "Track name", "Album name", "", new Uri("/path/to/logo", UriKind.Relative)); </code></pre> <p><strong>This works great on both Windows Phone 7 and Windows Phone 8 devices</strong> - audio player is able to play the track just fine. The debug output prints <code>True</code> as the result for the test if file exists. </p> <p>I've now converted the application in Visual Studio 2012 to be a Windows Phone 8 application. If I now run the application in Windows Phone 8, I get a <code>System.IO.FileNotFoundException</code> external exception from the player. Also in the converted version the debug output prints <code>True</code> when checking if the file exists. </p> <p><strong>I only converted the app from a WP7 to WP8 app</strong> and I cannot refer to files in <code>shared/transfers</code> any more.</p> <p>Why?</p> <p>What's the proper way to do this? </p> <p>I already tried referring to the files by using the URI <code>isostore:/shared/transfers/song.mp3</code> but that didn't seem to have an effect. </p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload