Open Closed

AbpSystemTextJsonSerializerOptions Self referencing loop detected #6176


User avatar
0
ElifKaya created

Hi,

I'm using AbpSystemTextJsonSerializerOptions configuration. Even though I ignore cycles, it throws a referencing loop exception. Can you give an advice for this problem, please?

Thank you

Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, and please first use the search on the homepage. Provide us with the following info:

  • ABP Framework version: v7.3.1
  • UI Type: / MVC /
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes
  • Exception message and full stack trace:
  • Steps to reproduce the issue:

3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The error belongs to Newtonsoft Json instead of SystemTextJson

    Can you share Steps to reproduce the issue? Thanks

  • User Avatar
    0
    ElifKaya created

    Newtonsoft

    I used AbpSystemTextJsonSerializerOptions configuration in our module template solution, it works actually. And, I send also response data from swagger. (I used NetTopologySuite library also).

    But, when I used this module in our other module solution as a package reference, it throws self referencing loop exception.


    The problem is here, the other solution which uses our module template module. I also add AbpSystemTextJsonSerializerOptions configuration in its HttpApiHostModule and WebHostModule.


  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Your application is using NewtonsoftJsonOutputFormatter now. Its behavior is controlled by MvcNewtonsoftJsonOptions https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.mvcnewtonsoftjsonoptions?view=aspnetcore-7.0

    Please check your code. Possibly accidentally used AddNewtonsoftJson.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09