Hi, I try to make an tiny android project & try to deserialize a Json file, but each time I have this exception :
System.IO.DirectoryNotFoundException: Could not find a part of the path "/Platformer/Json/Level/document.json"."
( You can find the project here : https://www.dropbox.com/s/ot4kkor0j27kt8q/Platformer.zip?dl=0 )
The json file called "document.json" :
"name": "Niveau 1"
I also make an Json test project for a Window Project using this code, and it work fine.
protected LevelJSON GetLevelJSON(string psFileName)
using (MemoryStream stream = new MemoryStream(Encoding.UTF8.GetBytes(File.ReadAllText(psFileName))))
DataContractJsonSerializer ser = new DataContractJsonSerializer(typeof(LevelJSON));
myLevelJSON = (LevelJSON)ser.ReadObject(stream);
And finally, there is one thing that confuses me, when I add the reference for the Json (for use : using System.Runtime.Serialization; ), the PC version & Android version isn't the same. ( Maybe it doesn't work because of that, but I have no idea ... )
( I'm French, so my visual studio is in French )
Also, I use in the both projects besides "using System.Runtime.Serialization;" :
I spent my weekend to try different things and I'm stuck, I have no idea what is wrong.
Thank to reply if you have any idea about that.