Hello,
In my project i use xml to communication between ASP.NET MVC and Unity WebGL.
During the deserialization I get an error:
This XML has 2-4 MB.
Issue exist in below part of code:
using (MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
{
XmlDictionaryReader reader = XmlDictionaryReader.CreateTextReader(memoryStream, Encoding.UTF8, new XmlDictionaryReaderQuotas() { MaxDepth = int.MaxValue, MaxArrayLength = int.MaxValue, MaxBytesPerRead = int.MaxValue, MaxNameTableCharCount = int.MaxValue, MaxStringContentLength = int.MaxValue }, null);
DataContractSerializer serializer = new DataContractSerializer(typeof(T));
var result = (T)serializer.ReadObject(reader);
return result;
}
I have repeated this problem on latest Unity 2017.X(Stable) and latest Unity 2018.X(Beta).
Does anyone have any ideas?
Thanks,
Paweł