Search code examples
c#botframeworkbot-framework-composer

Getting error "The reader’s MaxDepth of 64 has been exceeded" only in webchat, not in the Emulator


As the title says, I am getting the error:

The reader’s MaxDepth of 64 has been exceeded. Path ‘DialogState.dialogStack.$values[0].state._adaptive.actions.$values[0].dialogStack.$values[0].state._adaptive.actions.$values[0].dialogStack.$values[0].state._adaptive.actions.$values[0].dialogStack.$values[0].state._adaptive.actions.$values[0].dialogStack.$values[0].state._adaptive.actions.$values[0].dialogStack.$values[0].state._adaptive.actions.$values[0].dialogStack.$values[0].state._adaptive.actions.$values[0].dialogStack.$values[0].state.options.choices[0]’.

Initially, the problem was appearing both in the Emulator and the webchat. The cause for the issue was because I had a second Newtonsoft Json nuget package in one of my project references that was overriding and messing up the newtonsoft json used by the Chatbot. Removing the second newtonsoft json package fixed the issue.

But it appears it was only a partial fix. The problem still seems to be appearing in the Webchat and only in the webchat.

All I did was do several jumps into a few dialogs so the actual Dialog Stack physically couldn't have surpassed the max depth of 64.

I have absolutely no idea where to even begin searching for the issue and googling gives 0 results so if anybody has potential solutions I would be very grateful.

In the meantime, I will be picking apart the bot project to hopefully, through trial and error, find the culprit for the issue.


Solution

  • The issue was that the release binaries were not recreated during the "publish" process inside the Bot Framework Composer. Deleting the release binaries and forcing it to be recreated solved the issue.