The newtonsoft serializer does not support the hosts file. You should set the max depth with the serializer settings when you configure using newtonsoft.
.NET 8 upgrade issue for functions using Durable functions and Orchestrator
I have upgraded Function which uses Orchestrator and Durable functions from .Net 6 to .Net 8 (isolated model) and after upgrade when I am trying to run the function, I am getting the error.
An unexpected failure occurred while processing instance 'bfac8741288e59fd9868ae537b3ae370': Newtonsoft.Json.JsonReaderException: The reader's MaxDepth of 64 has been exceeded. Path 'OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[1].OrchestrationTraceContexts[0]', line 1, position 9933.
And I am using Newtonsoft to deserialize the json but after deserializing when it goes into Orchestrator triggered function during calling subOrcestrator function it won't process further.
Tried by adding the below configuration in host.json for the function but it did not work.
{
"version": "2.0",
"orchestrator": {
"maxDepth": 128
},
"extensions": {
"durableTask": {
"serialization": {
"maxDepth": 128
},
"tracing": {
"distributedTracingEnabled": true,
"distributedTracingProtocol": "W3CTraceContext"
}
}
}
And also tried to set maxDepth property to 128 during deserializing but its not working. Can someone please help on this.