简体   繁体   English

样本/模板Azure Bot Framework解决方案'EchoBot'中的错误,没有修改任何代码

[英]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.

相关问题 如何使用Bot框架(Echobot,使用ITurnContext)进行单元测试的设置 - How to make a set up for unit testing with the bot framework (Echobot, using ITurnContext) 以下代码中的闭包修改是否有可能出错? - Is there any possibility that there is an error by modified closure in the following code? 实体框架实体状态未经任何修改即被修改 - Entity Framework entity state is modified without any modification Azure Bot模板-BotApplication - Azure Bot template - BotApplication 没有Azure连接到电报的Bot Framework c# - Bot Framework c# without Azure Connection to Telegram 有没有办法在没有 azure bot 服务的情况下使用身份验证服务? - Is there any way to use authentication service without azure bot service? 如何在Microsoft Bot Framework中避免“抱歉,我的机器人代码有问题” - How to avoid “Sorry, my bot code is having an issue” in Microsoft Bot Framework 从Web客户端调用Microsoft Bot Framework机器人而无需在Azure上托管 - Call Microsoft Bot Framework bot from Web Client without hosting on Azure 如何在没有 Azure Bot 服务的情况下向 Bot Framework v4 项目添加身份验证? - How to add authentication to a Bot Framework v4 project without Azure Bot Service? 我将Azure Bot Service的Microsoft文档中的示例代码插入哪个文件中? - In which file I insert the sample code from the Microsoft documentation of the Azure Bot Service?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM