problem with reading file in xamarin forms
i have this code
var data = File.ReadAllText("../MOCK_DATA.json");
and it has problems reading this file i get this error8 Replies
This is my File tree and im trying to access
MOCK_DATA.json
from SearchService.cs
Try taking the
../
offit gives me same error
make sure the file exists wherever the app is compiling to
yes checked it and it is
and it's in the same exact folder as the executable/dll?
if so
File.ReadAllText("MOCK_DATA.json");
should work fineyes it is i dont know whats wrong too
looks fine
maybe try debugging a bit, outputting the current directory, listing directory contents through code, seeing if it can see the file, etc