TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Emanuele Leoni
NA
139
16.8k
Error: Stack is empty exception in Bot Framework
Mar 20 2018 5:57 AM
Hi,
I created a chatbot by Bot Framework and I implemented a Reset option in order to delete the conversation e grant to the user to begin a new conversation.
// MessageController.cs
public
async Task
Post([FromBody]Activity activity)
{
await Conversation.SendAsync(activity, () =>
new
RootDialog().DefaultIfException());
return
Request.CreateResponse(HttpStatusCode.OK);
<- Stack is empty Exception
}
// RootDialog.cs
private
void
ShowMenuOptions(IDialogContext context)
{
List<
string
> optionList =
new
List<
string
>();
optionList.Add(
"Info"
);
optionList.Add(
"Support"
);
optionList.Add(
"Reset"
);
string
prompt =
"How can I help you?"
;
PromptDialog.Choice(context,
this
.OnOptionSelected, (IEnumerable<
string
>)optionList, prompt, retry, attempts);
}
private
async Task OnOptionSelected(IDialogContext context, IAwaitable<
string
> result)
{
try
{
string
optionSelected = await result;
switch
(optionSelected)
{
case
"Reset"
:
context.Reset();
context.ConversationData.Clear();
context.PrivateConversationData.Clear();
context.UserData.Clear();
break
;
}
}
}
When an user chooses reset option, the bot answers with "Sorry, my bot code is having an issue."
Debugging the code I see that the exception triggers after context.Reset().
Can anybody help me and solve it?
Reply
Answers (
1
)
edit opearation of cascading dropdown list
PDF from jsPDF is not working in iE11