Q:

JSON Serialize and Deserialize with List not working

i have the following problem on my development:
i want to serialize and save a List of strings (System.List) on my iPhone. The List contains Errormessages which occurs by the running application. 
Then i want to Load it back and Deserialize it to save the list in my Application. This happens with the following code (Code shortened, unnessesary parts cut off):
List<string> MyList = {"Message One", "Message two"};

//Serialize 
string Temp = Newtonsoft.Json.Jsonconvert.SerializeObject(MyList);

//Save Data
using (Streamwriter sw = File.AppendText(Path))
{
     sw.WriteLine(Temp);
}

//Load Data
MyList = Newtonsoft.Json.Jsonconvert.Deserialize<List<string>>(File.ReadAllText(Path));

And then i get the exception 
"Error converting value "one" to type 'System.Collections.Generic.List`1[System.String]'."
Output on the iOS System is in a .txt file:
["One","Two"]
What's the problem?

A:

Problem is on: File.AppendText("C:\temp\t.txt")
it will append new lines on every run. after 1 run. you cannot convert All file content.
            List<string> MyList = new List<string>{ "One", "two" };

            //Serialize 
            string Temp = JsonConvert.SerializeObject(MyList);

//Do this.
            File.WriteAllText("C:\\temp\\t.txt",Temp);

            //Comment this.
            //using (StreamWriter sw = File.AppendText("C:\\temp\\t.txt"))
            //{
            //    sw.WriteLine(Temp);
            //}

            //Load Data
            MyList = JsonConvert.DeserializeObject<List<string>>(File.ReadAllText("C:\\temp\\t.txt"));

