So I am trying to use forms for the first time, I have been working with grids previously, and whenever I include a form on a Razor page or partial view within a Razor page it throws the following error.
JsonSerializationException: Self referencing loop detected for property 'Module' with type 'System.Reflection.RuntimeModule'. Path 'PageContext.ActionDescriptor.HandlerMethods[0].MethodInfo.Module.Assembly.EntryPoint'.
I tested this on several projects using custom models and the identity model and got the same result.
I saw on some older posts to include the following to the AddNewtonsoftJson options => options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; but this did not work.
(also tried it with the recommended serialization on https://docs.telerik.com/aspnet-core/installation/json-serialization)
I do have grids setup without issue.
Any idea what could be causing this?
see the attached file for the call stack and raw exception details
Versions:
ASP.net core 6
Microsoft.AspNetCore.Mvc.NewtonsoftJson 6.0.11
Telerik.UI.for.AspNet.core 2022.3.1109