none
Reading files from KnownFolders.DocumentsLibrary fails (E_ACCESSDENIED) when Documents folder is under Known Folder Move (KFM) on OneDrive RRS feed

  • Question


  • I have an app reading files from KnownFolders.DocumentsLibrary using StorageFolder/StorageFile. Before Onedrive takes over the Documents folder my app was working ok. So all Capabilities / File Type Associations in the app manifest are declared.

    I've tried to declare broadFileSystemAccess capability but got the same result.

    StorageFolder folder = Windows.Storage.KnownFolders.DocumentsLibrary;string content = await FileIO.ReadTextAsync("file.txt", Windows.Storage.Streams.UnicodeEncoding.Utf8);

    I expect to read the file as before but now I get {System.UnauthorizedAccessException: (Exception from HRESULT: 0x80070005 (E_ACCESSDENIED)) }




    • Edited by Pedro67 Thursday, March 28, 2019 8:36 PM
    • Moved by Barry Wang Friday, March 29, 2019 9:15 AM
    Thursday, March 28, 2019 8:34 PM

All replies

  • Hello Pedro67,

    We are not OneDrive specialist so you may need to contact OneDrive support for help. From what I can read per this doc, it seems your problem is due to the policy from OneDrive which restrict the app from reading your file. I don't think you can work by using broadFileSystemAccess, you should check the policy part for OneDrive.

    Best regards,

    Barry


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.


    • Edited by Barry Wang Friday, March 29, 2019 9:14 AM
    Friday, March 29, 2019 9:14 AM