locked
System.Runtime.InteropServices.COMException happens while calling GetFilesAsync()

    Question

  • Hi,

    I am trying to get all the files in a folder  called "Sample" which is in LocalFolder..

    My code is:

     StorageFolder localFolder = ApplicationData.Current.LocalFolder;

     StorageFolder sampleFolder = await localFolder.GetFolderAsync("Sample");

    IReadOnlyList<StorageFile> filesFromStorage = await sampleFolder .GetFilesAsync();

    but when app executes the GetFilesAsync() throws System.Runtime.InteropServices.COMException.. How to solve this problem?? Kindly give me a solution..

    Thanks,

    Saturday, April 25, 2015 4:54 AM

All replies

  • Hi PM16,

    Unfortunately, I can't reproduce this issue on my side, this API worked well as below:

    Could you explain more about how and where you used this API? In the code behind or in a BackgroundTask?

    If possible, could you please provide a simple demo for troubleshooting?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Monday, April 27, 2015 5:35 AM
    Moderator
  • Hi PM16,

    Any updates?


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, May 6, 2015 11:58 AM
    Moderator
  •  StorageFolder localFolder = ApplicationData.Current.LocalFolder;

     StorageFolder sampleFolder = await localFolder.GetFolderAsync("Sample");

    IReadOnlyList<StorageFile> filesFromStorage = await sampleFolder .GetFilesAsync();

    the above code works fine in my another windows 8.1 machine... but it throws the above mentioned exception in my another machine..

    What could be wrong with my machine? can you please suggest me any solution?

    Thursday, May 14, 2015 11:20 AM