【发布时间】:2017-09-09 05:20:46
【问题描述】:
当我将以下代码同步到我的 Git 项目并在我的 Azure Bot 实例通道上进行测试时,我的以下代码运行良好:
[LuisIntent("Greeting")]
public async Task Greeting(IDialogContext context, LuisResult result)
{
string s = string.Empty;
string name = string.Empty;
var entities = new List<EntityRecommendation>(result.Entities);
if (entities.Any((entity) => entity.Type == "ClientName"))
{
var clientName = entities.Where((entity) => entity.Type == "ClientName").First();
name = clientName.Entity;
s += "Your name is " + name;
}
else
{
s += "What is your name?";
}
await context.PostAsync($"You gave a greeting. {s}");
context.Wait(MessageReceived);
}
但是当我在模拟器上运行它时,我收到“抱歉,我的机器人代码有问题”。出现以下错误:
发生了 ScriptHost 错误 执行函数时出现异常:Functions.messages。 Microsoft.Bot.Builder: 值不能为空。 参数名称:modelID。
最重要的是我收到警告:
找不到程序集“Microsoft.Bot.Builder.resources,版本=3.9.0.0, 文化=en-US,PublicKeyToken=31bf3856ad364e35'。您是否缺少私人 汇编文件?
如何让它在我的模拟器上运行?在将其推送到我的实例之前,我宁愿先在本地对其进行测试。
【问题讨论】:
-
我会删除并阅读 BotBuilder nuget 包
-
嗨,我该怎么做?我的解决方案中没有 Nuget 包管理器。我从 Azure 门户下载了代码。我尝试从 project.json 和 messages.csproj 中注释掉 Microsoft.Bot.Builder 包,但这对我的问题没有任何影响。
标签: c# azure-language-understanding azure-bot-service