Hey i have the following :
var fileList = await KnownFolders.MusicLibrary.GetItemsAsync();
It doesn't return any files and i have files in the Music folder. I also have :
<Capabilities>
<Capability Name="internetClient" />
<Capability Name="removableStorage" />
<Capability Name="documentsLibrary" />
<Capability Name="MusicLibrary" />
<Capability Name="HomeGroup" />
<Capability Name="RemovableDevices" />
I dont know why it doesnt return any files/ exception ? Any suggestions ? I also tried FolderPicker to get all files in a folder , but same result.
Form the code you've posted, it seems you are using wrong capabilities.
For more info, please see App capability declarations.
So you can chane your
Package.appxmanifestlike the following:And then you should be able to get the files and subfolders in the music library.
The Music Library typically has the following path.
You can check if you have files under this path. And also you can check the path with the following code.
This will output the path of the known folder, which is the folder in a library where new files are saved by default. For more info, please see this answer.