【发布时间】:2022-06-26 09:09:17
【问题描述】:
我们正在使用机器人框架在 .netframework 4.7.2 中创建一个录制机器人。我们正在从头开始制作这个机器人。我们一度陷入困境。请查看下图以查看我们面临的错误:我们正在尝试做的是我们正在制作一个机器人控制器,并且在 (await Adapter.ProcessAsync(Request, Response, Bot)) 响应处出现错误.请看下面的代码:
using Microsoft.Bot.Builder;
using Microsoft.Bot.Builder.Integration.AspNet.WebApi;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Web;
using System.Web.Http;
using System.Web.Mvc;
using HttpGetAttribute = System.Web.Http.HttpGetAttribute;
using HttpPostAttribute = System.Web.Http.HttpPostAttribute;
namespace ScratchTeamrecordingBot.Controllers
{
[System.Web.Http.Route("api/messages")]
public class HomeController : ApiController
{
private readonly IBotFrameworkHttpAdapter Adapter;
private readonly IBot Bot;
public HomeController(IBotFrameworkHttpAdapter adapter, IBot bot)
{
Adapter = adapter;
Bot = bot;
}
[HttpPost, HttpGet]
public async Task PostAsync()
{
// Delegate the processing of the HTTP POST to the adapter.
// The adapter will invoke the bot.
await Adapter.ProcessAsync`(Request, Response, Bot);
}
}
}
We are creating a recording bot in .netframework 4.7.2 using the bot framework. We are making this bot from scratch. we were stuck at one point. please see the image below to see the error we are facing: What we are trying to do is we are making a bot controller and in that, we are getting an error at ( await Adapter.ProcessAsync(Request, Response, Bot)) response. please see the code below:
【问题讨论】:
-
你需要告诉我们错误到底是什么。红色波浪线没有告诉我们任何信息。您是否检查过 API 参考以了解您是否正确使用了该功能?
标签: botframework .net-4.8