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)
-
0
hi
The error belongs to Newtonsoft Json instead of SystemTextJson
Can you share
Steps to reproduce the issue
? Thanks -
0
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.
-
0
hi
Your application is using
NewtonsoftJsonOutputFormatter
now. Its behavior is controlled byMvcNewtonsoftJsonOptions
https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.mvc.mvcnewtonsoftjsonoptions?view=aspnetcore-7.0Please check your code. Possibly accidentally used
AddNewtonsoftJson
.