#

Fehlermeldung: CommonFileQuery.OrderByDate The specified query options are not available for this folder because it is not within a library

 

Fehlermeldung:

System.ArgumentException: 'The parameter is incorrect.

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.'

 

 

Betrifft: Laden von StorageFiles aus einem Folder

StorageFile file in await folder.GetFilesAsync(Windows.Storage.Search.CommonFileQuery.OrderByDate)

 

 

Dateien in Ordner sortieren

C# UWP Laden von Files aus Folder

 

Lösung:

Sortieren von Dateien mit List

 

//< get Files sorted >

IReadOnlyList<StorageFile> files = await folder.GetFilesAsync();

IEnumerable<StorageFile> sortedFiles = files.OrderByDescending((x) => x.DateCreated);

//</ get Files sorted >

 

//----< @Loop: Files in Folder >----

foreach (StorageFile file in sortedFiles)

{

   Console.WriteLine(file.DisplayName);

..

 

 

Mobile

.