Attempting to Serialize a class containing a ArrayList crashes VS 2022 while runing the code in debugging.
what I manage to get before VS closed.
static void JSON_Test()
{
MyTestClass mtc = new MyTestClass();
JToken jt = JsonConverter.Serialize(mtc); // gl
string s = jt.ToString();
var bytes = Encoding.UTF8.GetBytes(s);
}
class MyTestClass
{
public int I { get; set; }
public ArrayList MyList { get; set; }
public MyTestClass()
{
MyList = new ArrayList();
MyList.Add(new MyTestClass2());
MyList.Add(new MyTestClass2());
MyList.Add(new MyTestClass2());
}
}
class MyTestClass2
{
public int I { get; set; }
}