Thank you for visiting.
Here is the issue I am facing and would appreciate some help.
I am trying to access a file in a .NET standard DLL. Everything works if I use the Windows.Storage namespace, in a test UWP app, like so:
Windows.Storage.StorageFile f = await StorageApplicationPermissions.FutureAccessList.GetFileAsync("TestPickedFileToken1");
txt.Text = await Windows.Storage.FileIO.ReadTextAsync(f);
The real app is a MVVM UWP app (targeting Fall Creators Update) that accesses a .NETStandard 2.0 DLL. The problem is that I can't find the assembly that contains Windows.Storage namespace to add to my DLL. It is available in the UWP and when I try to use the following in System.IO it gives me an access to path denied error in the DLL:
string s = File.ReadAllText(filename);
I need to read/write to the file from the DLL. It will work if I read/write in the ViewModel of the UWP app but I don't want to do that. Is it possible add a reference to Windows.Storage in my DLL or is there an alternative to accessing a file in the DLL?
Thanks in advance for your help!