Creating a folder on SD card
-
Sunday, July 15, 2012 7:34 AM
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
- Moved by Matt SmallMicrosoft Employee, Moderator Monday, July 16, 2012 2:10 PM Hardware issue (From:Building Metro style apps with C# or VB )
All Replies
-
Wednesday, July 18, 2012 1:01 PM
Today it started to work without any change to the code.
The only thing is windows did an update an reboot automatically.
Software engineer
- Marked As Answer by DavidLambMicrosoft Employee, Moderator Wednesday, July 18, 2012 2:41 PM
-
Wednesday, July 18, 2012 2:41 PMModerator
If it happens again, please capture a procmon log to begin with so we can determine if the device was accessed.
Thanks!
David Lamb


