locked
Creating a folder on SD card

    Question

  • I have a metro style application that needs to do automatic backup to an SD Card.

    In manifest capabilities I checked the "Removable Storage" option but when I try to create a folder on the SD Card using "

    CreateFolderAsync" I get the following exception:

    "Error HRESULT E_FAIL has been returned from a call to a COM component."

    using exactly the same command but in the Documents folder works good.

                    StorageFolder Devices = Windows.Storage.KnownFolders.RemovableDevices;
                    StorageFolder BackupDevice = await Devices.GetFolderAsync(BackupDrive); //BackupDrive is the SD Card folder
                    if (BackupDevice != null)
                    {
                        StorageFolder tst = Windows.Storage.KnownFolders.DocumentsLibrary;
                        BackupFolder = await tst.CreateFolderAsync(mBackupFileNamePreffix, CreationCollisionOption.OpenIfExists); //For test works OK
                        BackupFolder = await BackupDevice.CreateFolderAsync(mBackupFileNamePreffix, CreationCollisionOption.OpenIfExists); //Generate an exception
                        if (BackupFolder != null)
                            status = BIONESSDBBackupFoldeStatus.OK;
                    }


    Software engineer

    Sunday, July 15, 2012 7:34 AM

Answers

  • Today it started to work without any change to the code.

    The only thing is windows did an update an reboot automatically.


    Software engineer

    Wednesday, July 18, 2012 1:01 PM

All replies

  • Today it started to work without any change to the code.

    The only thing is windows did an update an reboot automatically.


    Software engineer

    Wednesday, July 18, 2012 1:01 PM
  • If it happens again, please capture a procmon log to begin with so we can determine if the device was accessed.

    Thanks!


    David Lamb

    Wednesday, July 18, 2012 2:41 PM
    Moderator