PCLStorage icon indicating copy to clipboard operation
PCLStorage copied to clipboard

Reading file from local storage fails on UWP

Open zippo227 opened this issue 8 years ago • 4 comments

After creating a path using the PortablePath and passing in LocalStorage, I am only able to access it if I use GetFileFromPathAsync. It fails when I use LocalStorage.GetFileAsync. It wo

   string path = PortablePath.Combine(FileSystem.Current.LocalStorage.Path, model.filename);
   
   //Succeeds on UWP, iOS, and Android
   IFile file = await FileSystem.Current.GetFileFromPathAsync(path);
   
   //Fails on UWP, succeeds on iOS and Android
   IFile file = await FileSystem.Current.LocalStorage.GetFileAsync(path);

zippo227 avatar May 09 '17 20:05 zippo227

I was getting Exception thrown: 'System.NotImplementedException' in PCLStorage.dll

when executing on UWP (but code is in a PCL) IFolder rootFolder = FileSystem.Current.LocalStorage;

Problem was that I had not added the nuget package to the UWP application, although I had added it to the PCL. Needs to be in both places.

jhooper91 avatar May 30 '17 21:05 jhooper91

@zippo227 can you close the issue if it has been resolved?

xavier-rigau avatar Jun 15 '17 16:06 xavier-rigau

@xavier-rigau the issue is not resolved. I did have the PCL in the proper locations. Has an update been pushed to fix this issue that I should test?

zippo227 avatar Jun 15 '17 18:06 zippo227

Wew, 45 open issues, 7 pending pull requests. This library seems to move to trash :(

haison8x avatar Jun 16 '17 03:06 haison8x