Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

too much recursion WebGL

Discussion in 'WebGL' started by Uchihagam, Apr 18, 2018.

  1. Uchihagam

    Uchihagam

    Joined:
    Mar 26, 2017
    Posts:
    7
    Hello,

    In my project i use xml to communication between ASP.NET MVC and Unity WebGL.
    During the deserialization I get an error:
    upload_2018-4-18_9-11-29.png

    This XML has 2-4 MB.
    Issue exist in below part of code:
    Code (CSharp):
    1.             using (MemoryStream memoryStream = new MemoryStream(Encoding.UTF8.GetBytes(xml)))
    2.             {
    3.                 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);
    4.  
    5.                 DataContractSerializer serializer = new DataContractSerializer(typeof(T));
    6.                 var result = (T)serializer.ReadObject(reader);
    7.                 return result;
    8.             }
    I have repeated this problem on latest Unity 2017.X(Stable) and latest Unity 2018.X(Beta).

    Does anyone have any ideas?

    Thanks,
    Paweł
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    do you have a development build callstack?
     
  3. Uchihagam

    Uchihagam

    Joined:
    Mar 26, 2017
    Posts:
    7