Configured SD card path in emulator is null - Windows Phone 8.1 (runtime)

admin

Administrator
Staff member
I am very much confused with WP 8.1 (runtime) SD card access. I am trying to create a folder in WP 8.1 (Runtime) Sd Card, but unable to do so. I am following <a href="https://msdn.microsoft.com/en-us/library/windows/apps/xaml/dn611857.aspx" rel="nofollow">MSDN</a> tutorial to access sd card in WinRT. I need SD card access in order to store my App's backup &amp; log folders. By following <a href="https://monkeyweekend.wordpress.com/2014/12/09/write-a-file-to-the-sd-card-on-windows-phone-8-1/" rel="nofollow">this</a> tutorial I configured sd card path in emulator and I am using below code to access that path.

Code:
 private async Task&lt;string&gt; AsyncExternalStoragePath()
 {
   // Get the logical root folder for all external storage devices.
   Windows.Storage.StorageFolder externalDevices = Windows.Storage.KnownFolders.RemovableDevices;

   // Get the first child folder, which represents the SD card.
   StorageFolder sdCard = (await externalDevices.GetFoldersAsync().AsTask().ConfigureAwait(false)).FirstOrDefault();


 }

Code:
externalDevices.Path
returns empty string instead of returning the path which I configured. I enabled
Code:
RemovableStorage
under
Code:
Capabilities
and added
Code:
FileTypeAssociations
. But honestly this
Code:
FileTypeAssociations
are very much confusing to me. I read many articles, but I am not yet clarified fully.

Basically I want two folders and one file under my app name folder.

Code:
AppnameFolder -&gt; BackupFolder, LogFolder, Infile

Under each folder

Code:
Backup -&gt; To keep last five backup files (.db)
Log -&gt; To create log files per day basis (.txt)
inifile -&gt; To enable logging

If I know how to create a custom folder (app name folder) in sd card, I would create sub-folders (backup, log) easily. But right now I am stuck in getting the root path.

<strong>Edit</strong>: Deadlock problem got solved by adding
Code:
ConfigureAwait(false)
in async call as suggested in comment, but sdcard path is still null, How can I get path and create folder there?