I'm using .Net Core version: 2.2
Sample code scenario causing the System.StackOverflowException
public string Method1(string jsonData)
{
    dynamic dObject = JObject.Parse(jsonData);
    string strData = Method2(dObject);
    return strObject;
}
public string Method2(dynamic dObj)
{   // <-- debugger breaks the program with exception at this line
    // ...some logic
    return data
}
The JObject.Parse() method is from Newtonsoft.Json.Linq namespace
System.StackOverflowException
HResult=0x800703E9
Message=Exception of type 'System.StackOverflowException' was thrown.
Same code is working with .Net Framework. Getting issue while converting to .Net Core
User contributions licensed under CC BY-SA 3.0