Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

JsonException: A possible object cycle was detected. This can either be due to a cycle or if the object depth is larger than the maximum allowed depth of 32. Consider using ReferenceHandler.Preserve on JsonSerializerOptions to support cycles.

services.AddControllersWithViews()
    .AddNewtonsoftJson(options =>
    options.SerializerSettings.ReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore
);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #A #object #cycle #This #due #cycle #object #depth #larger #maximum #allowed #depth #Consider #JsonSerializerOptions #support
ADD COMMENT
Topic
Name
6+6 =