在VS 2019号问题中调试C#bot-通过MS团队向机器人发送消息后,机器人没有响应

发布于 2025-02-06 01:23:49 字数 1529 浏览 2 评论 0原文

我有一个使用.NET 4.8中的BOT框架在C#中编程的机器人。该机器人在Azure中具有机器人通道注册,该机器人在Azure Active Directory中挂钩的App Active Directory中的现有应用程序注册,这是我的应用程序ID与App Secret一起起源的地方。现在,要调试我的机器人,我运行了Ngrok,将URL隧道隧道隧道隧道隧道隧道隧道隧道隧道隧道隧道挖到了我的Localhost,这是我调试时机器人运行的。如下所示,消息传递端点是维持“ API/消息”部分的NGrok URL,这是API端点,MS团队中的所有消息都将在我的机器上使用。

此处的应用ID匹配应用程序注册之一,以及我的Web.config文件中的一个。我已经在我的Web.config文件中检查了“应用程序设置”以及连接字符串,它们是正确的。

​.0.1:4040/Inspect/http“ rel =“ nofollow noreferrer”> http://127.0.0.0.1:4040/inspect/http )。

一旦将MS团队的消息发送到机器人,我希望将此断点击中。

但是,它不会受到命中,也没有错误或异常。 Ngrok终端上要么没有任何东西。我尝试将防火墙关闭以为可能与安全有关,但这并没有改变结果。当我将消息传递端点更改为实际托管机器人应用程序URL的端点时,当在MS团队中发送消息时,机器人会按预期做出响应。在尝试使用Ngrok进行调试之前,这曾经在工作之前起作用,但现在突然停止了工作。关于问题可能是什么的想法?我错过的Ngrok或Azure End有任何变化吗?任何帮助将不胜感激,谢谢!

I have a Bot that has been programmed in C# using the Bot Framework in .NET 4.8. This Bot has a Bots Channels Registration in Azure, which hooks into an existing app registration in Azure Active Directory, which is where my App ID originates from along with the App Secret. Now to debug my Bot I run Ngrok to tunnel the URL to my localhost at port 3980, which is what the Bot runs in when I debug it. As you can see below the messaging endpoint is the ngrok URL with the "api/messages" part maintained, which is the API endpoint that all messages from MS Teams will go to in my Bot.

enter image description here

The App ID here matches the one of the app registration and the one in my web.config file. I have checked the "app settings" in my web.config file along with the connection string and they are correct.

enter image description here

enter image description here

When I send a message to my Bot in MS Teams nothing comes through and nothing is picked up in the ngrok inspector (http://127.0.0.1:4040/inspect/http).

enter image description here

I would expect this breakpoint to be hit once a message from MS Teams is sent to the Bot.

enter image description here

However, it doesn't get hit and no error or exception is thrown. Nothing is either picked up in the ngrok terminal. I've tried switching my firewall off thinking it may have been security related but this didn't change the outcome. When I change the messaging endpoint to be that of the actual hosted Bot app url, the Bot responds as expected when a message is sent to it in MS Teams. This used to work before when trying to debug using ngrok but now it has suddenly stopped working. Any ideas on what the problem might be? Has anything changed at the ngrok or azure end possibly that I've missed? Any help would be much appreciated on this, thanks!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

遗失的美好 2025-02-13 01:23:49

要检查机器人的功能,第一步是在 Web Chat 中对其进行测试。 编程语言创建机器人时

  • 使用任何
  • 当 在您的情况下没有错误)
  • 在一个通道中工作,而在剩余的频道中的错误。

当我们使用 Web聊天测试机器人时,我们可以确定错误的原因,无论是在机器人侧还是来自特定的频道(在这种情况下 MS团队)。

网络聊天中的测试:
必须有一个功能齐全的功能,并且必须可以使用bot进行测试。

  • goto azure门户(portal.azure.com)
  • 打开“ Web Chat中的测试”选项
  • 尝试将消息发送到您的bot。

如果机器人没有响应消息,请参阅“ bot在网络聊天中不工作 ”,如果情况类似于“ bot”> bot在一个平台上工作,而在另一个平台上工作,而在另一个平台上工作

检查频道配置问题 来自

文档信用@jonathanfingold 和团队

To check the functionality of bot, the first steps is to test it in WEB CHAT. When the bot was created using any programming language (language is not a major criterion for error), the following will be the possible errors:

  • Not being able to respond (the current issue)
  • Throwing errors (As there are no errors in your case)
  • Working in one channel and error in remaining channels.

When we test the bot using WEB CHAT we can determine the reason for the error, whether it is with bot side or from particular channel (MS Teams in this case).

Test in Web Chat:
There must be a fully functional and ready to use bot must be available to test.

  • Goto Azure portal (portal.azure.com)
  • Open the "Test in Web Chat" option
  • Try to send message to your bot.

enter image description here

If the bot is not responding to the message, refer "bot is not working in web chat" and if the case is like "bot working in one platform and not working in other"

Check the channel configuration issues from.

Document Credit @JonathanFingold and team

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文