Search code examples
c#windows-phonewindows-phone-8.1windows-8.1windows-10

Windows 10 FIle query issues


I am trying to follow the instructions to get files from the knownfolders in windows 10 as shown below,

https://msdn.microsoft.com/en-us/library/windows/apps/br227275.aspx

            try
            {
                StorageFolder folder = KnownFolders.PicturesLibrary;
                IReadOnlyList<StorageFile> pics = await folder.GetFilesAsync(Windows.Storage.Search.CommonFileQuery.OrderByDate, 0, 20);
                Debug.WriteLine(pics.Count);
            }

            catch(Exception ex)
            {
                Debug.WriteLine(ex.Message);
            }

The same code works in WindowsPhone 8.1 SDK. But on Windows 10 mobile it does not. The exception i get is this,

The specified query options are not available for this folder because it is not within a library or Homegroup. Only folders within a library or a Homegroup support all options.

Any Ideas as to how to fix this ?


Solution

  • Windows 10 is still under work. The latest build on the phone resolved this issue.