Hi,
I am building an MVC5 app and i am getting "a circular reference was detected while serializing an object". I am not sure if it's caused by the virtual call backs to my User entity or not. However i need to have those objects in my entity. Is the MVC helpers still buggy? or do i need to change to a json binding which i can do but i was hoping to keep it simple with the MVC helpers. Let me know what all you might need to help diagnose this issue sense the error page is listing off the @Html.Infragistics as throwing the issue.
Hello ekolluri,
Thank you for contacting us.
The issue may be related to the object that you are trying to serialize and the JSON serializer itself.
You can check the following references, where similar issues are discussed.
http://blog.davebouwman.com/2011/12/08/handling-circular-references-asp-net-mvc-json-serialization/
http://stackoverflow.com/questions/1153385/a-circular-reference-was-detected-while-serializing-an-object-of-type-subsonic
http://stackoverflow.com/questions/10027756/a-circular-reference-was-detected-while-serializing-an-object-of-type-in-asp-net
Also could you please send me code snippet or isolated sample that is showing the issue in order to investigate it further for you. This will be highly appreciated.
Looking forward to hearing from you.
Did you just want the code attached here or did you want me to submit a support request? As i do not see an option to send personal messages on this forum.
I've created a private case for you, the case number is CAS-139326-D8R6G6. You can find your active cases under Account -> Support Activity ->Active Cases.
Could you please send the code there.
I saw that for the 2013.1 there was a thread about lazy loading. I am wondering if that is what is causing the error, however it also throws this error when i do eager loading also. I would request some information on how the grid does EF navigation because the virtual object itself can be displayed (did a generic simple test to test a regular int and a virtual string and it worked just fine). Like i added in the support ticket we are using POCO/mapping files etc so we can have more control over the entities. I figured i would update it here because maybe another dev might see this and be able to add something to the conversation that might have found a fix for this issue.