locked
Can't access KnownFolders from Windows Store app RRS feed

  • Question

  • This line of code:

    IReadOnlyList<StorageFolder> folders = await KnownFolders.MusicLibrary.GetFoldersAsync();

    throws a Error HRESULT E_FAIL has been returned from a call to a COM component.
    Of course capability is there, otherwise i get "Access Denied"
    Since this happens also with MS samples i presume it depends on my machine, anyone has idea
    what causes this error?

    Cheers

     

    Corrado Cavalli [Microsoft .NET MVP-MCP]
    UGIdotNET - http://www.ugidotnet.org
    Weblog: http://blogs.ugidotnet.org/corrado/
    Twitter: http://twitter.com/corcav

    Wednesday, January 29, 2014 9:13 AM

Answers

  • As you note, since it happens with all apps it's a system configuration issue not a development issue. Is there anything unusual about the music library configuration for your user on that system? Has it been moved to a different location or drive, removed, etc.? Can you see the library from a desktop app (see the Known Folders Sample for an example).

    You may find more help about system issues in the Windows 8.1 forums on http://answers.microsoft.com

    --Rob

    Thursday, January 30, 2014 6:38 AM
    Moderator

All replies

  • Have you enabled on the Package.appxmanifest -> Capabilities : XX Libraries + Removable Storage?

    cmorgado

    Wednesday, January 29, 2014 9:56 AM
  • Yes, same error...

    Corrado Cavalli [Microsoft .NET MVP-MCP]
    UGIdotNET - http://www.ugidotnet.org
    Weblog: http://blogs.ugidotnet.org/corrado/
    Twitter: http://twitter.com/corcav

    Thursday, January 30, 2014 5:31 AM
  • As you note, since it happens with all apps it's a system configuration issue not a development issue. Is there anything unusual about the music library configuration for your user on that system? Has it been moved to a different location or drive, removed, etc.? Can you see the library from a desktop app (see the Known Folders Sample for an example).

    You may find more help about system issues in the Windows 8.1 forums on http://answers.microsoft.com

    --Rob

    Thursday, January 30, 2014 6:38 AM
    Moderator