【发布时间】:2017-07-20 14:22:56
【问题描述】:
在我的代码中,我像这样动态地将实体添加到 Luis Result:
[LuisIntent("Show Color")]
public async Task displayColor(IDialogContext context, LuisResult result)
{
EntityRecommendation color;
if (!result.TryFindEntity("color", out color)) {
color = new EntityRecommendation();
color.Entity = "white";
color.Type = "color";
result.Entities.Add(color); // <-- This Line Causes the Exception
}
}
奇怪的是这段代码以前可以工作,但现在已经停止工作,现在当result.Entities.Add(color); 行被命中时,机器人模拟器中会显示这个异常:
这是 Visual Studio 2015 中显示的异常:
这可能与错误的 Nuget 包版本有关吗?它之前运行顺利,但我添加了一些身份验证服务,现在出现了这个异常。感谢您的帮助。
【问题讨论】:
-
嗨,Megan,您是否已经尝试删除身份验证服务并一次添加一项,直到找到罪魁祸首/原因?
-
@JasonSowers 是的!我现在正在运行没有身份验证服务的机器人
标签: c# .net exception botframework azure-language-understanding