I'm trying to read a json file that is packaged with my app as soon as my app loaded. It is a json file that contins a list of Urls that is regarded a whitelisted url's.
But When I try to read the json file I get the following exception: The system cannot find the file specified. (Exception from HRESULT: 0x80070002)
I have set the Build Action of the json file to "Content", below asr a screen shot of my solution file structure, the json file content, and my methods. Please Help.
Screenshot of my solution file structure
public sealed partial class MainPage : Page
this.Loaded += MainPage_Loaded;
private async void MainPage_Loaded(object sender, RoutedEventArgs e)
var dataUri = new Uri("ms-appx:///WhiteListApp/Data/WhiteList.json");
var file = await StorageFile.GetFileFromApplicationUriAsync(dataUri);
var jsonText = await FileIO.ReadTextAsync(file);