locked
Windows Store Apps file not get saved in MusicLibrary for Simulator

    Question

  • I have downloader process which saves mp3 file into Music Library. Code below works for real device. So after download finishes, when I go to Music Library I can browse & play downloaded files, but on Simulator, even if download finishes successfully, I do not see files on Music Library. Also not getting any error. Am I missing something?

    StorageFile destinationFile = await KnownFolders.MusicLibrary.CreateFileAsync(
       fileName, CreationCollisionOption.GenerateUniqueName);
       BackgroundDownloader downloader = new BackgroundDownloader();
        XmlDocument content = new XmlDocument();
      downloader.SuccessToastNotification = new ToastNotification(content);
     DownloadOperation download = downloader.CreateDownload(source, destinationFile);

    Friday, January 23, 2015 1:23 AM

All replies

  • Hi reyou,

    Let's narrow down the question before trying to guess why.

    As I know CreateFile method will create a blank file for you even you do not have content to write in. Could you set a breakpoint here to see if the code successfully create the file?

    Besides I can use my simulator create the file successfully without any problem, let's change the second option as ReplaceExisting to see if the same thing happens.

    --James


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, January 23, 2015 9:40 AM
    Moderator
  • It creates file on real device with no problem, I do not get any kind of error on simulator as well. Just when I go to Music application on simulator I do not see song downloaded but on real device it works!
    Saturday, January 24, 2015 2:22 PM