I'm trying to read PCL content file that I'm adding with the resource. the ideal use case for this is a REST service mock where I want to host a few json files for testing the Network services. I want to be able to read these json files as an alternative if the server is not available so what do I do to be able to achieve this?
both the json files and the NetworkService class are within the PCL. assume no other solution is relevant
this is what I tried
- dragged the mock json files and folders into the solution
- set Build Action -> Content
- set Copy to Output Directory -> Copy if Newer
This is the part of the NetworkService fallback code
var uri = new Uri("ms-appx:///mock/users/" + UserID + "/GET.json");
var file = await StorageFile.GetFileFromApplicationUriAsync(uri);
I get a System.IO.FileNotFoundException when I try to run this code. any ideas what I could be doing wrong? I tried the EmbeddedResource approach and that didn't work either.