[英]Error in sample / template Azure Bot Framework solution 'EchoBot' without having modified any code
I have downloaded the Azure 'EchoBot' sample from Azure, using Azure Portal > Create Resource > Web App Bot > V4 Framework > Echo Bot. 我已经使用Azure门户>创建资源> Web App Bot> V4 Framework> Echo Bot从Azure下载了Azure'EchoBot'示例。
I downloaded the resulting scaffolding code, and it seems to have an error already in the sample? 我下载了生成的脚手架代码,它似乎已经在样本中出错了? I can't fix it myself, because I don't really understand the structure of the code yet. 我自己无法修复它,因为我还没有真正理解代码的结构。 This was to be my learning exercise. 这是我的学习练习。 It appears to be an error in the dependency injection during startup? 启动期间依赖注入似乎是一个错误? I have updated all nuget packages and confirmed that other examples/samples on the net have this same code? 我已更新所有nuget包并确认网上的其他示例/示例具有相同的代码? (Replacing 'EchoBot' with the name of their solution). (用其解决方案的名称替换'EchoBot')。 Can anyone assist? 有人可以帮忙吗? I can't even build and run the sample with this issue/error. 我甚至无法使用此问题/错误构建和运行示例。
Try EchoBot.Echobot
. 试试EchoBot.Echobot
。 The error message is telling you that it cannot resolve because you are using a namespace instead of a type. 错误消息告诉您它无法解析,因为您使用的是命名空间而不是类型。 You have two options here: 你有两个选择:
1) The dirty way - replace EchoBot
with EchoBot.EchoBot
. 1)脏方法 - 用EchoBot
替换EchoBot.EchoBot
。 The first EchoBot
being the namespace, and the second being the class inside that namespace. 第一个EchoBot
是命名空间,第二个是该命名空间内的类。
2) The nicer way - add using EchoBot = EchoBot.EchoBot;
2)更好的方式 - using EchoBot = EchoBot.EchoBot;
添加using EchoBot = EchoBot.EchoBot;
at the top of your Startup.cs
file. 在Startup.cs
文件的顶部。
The explanation being that the EchoBot
class declaration is inside the EchoBot
namespace - see the EchoBot.cs
file and you will see namespace EchoBot
near the top. 解释是EchoBot
类声明在EchoBot
命名空间内 - 请参阅EchoBot.cs
文件,您将看到namespace EchoBot
附近的namespace EchoBot
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.