TurnContext objects get disposed in Microsoft bot framework session timeout function

Tanzeel Ali 1 Reputation point
2022-09-07T08:58:05.707+00:00

I'm working on a scenario where the user is warned after 1 minute of inactivity and after another, 1-minute chat will auto close.

Callback is successfully invoked after 1 minute but when I'm using TurnContext to send a message to user then it shows an exception that "cannot access a disposed object".
The Locale in TurnContext is shown null and Microsoft.Bot.Connector.IConnectorClient is also null in TurnContext.TurnState
238536-turncontext-error.png

Can we prevent the object from getting disposed or if there is any other solution so please help me.

Thank you!

Azure AI Bot Service
Azure AI Bot Service
An Azure service that provides an integrated environment for bot development.
941 questions
Developer technologies | ASP.NET | ASP.NET Core
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.