I started learning bot framework last week, and i decided to start off with the default bot project that returns your input and its number of character. But unfortunately, I couldn't test the bot application in bot emulator. It can't just send my input. It displays "couldn't send" whenever I forward an input. My endpoint url which is http://localhost:3979/api/messages/ is correctly written there. What could be wrong? I'm just a starter in bot framework and bot building.
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
As I'm not aware of the exact code which you are trying to execute, I'd suggest few points to be checked again.
Checkpoints:
- Make sure you are running the code in debug mode with any browser (Edge, chrome, explorer etc.) and then run in the emulator.
- Configure or link the emulator with ngrok. (Though it is not required when running locally but it may resolve if the emulator is not working with firewall issues)
- Please check the Microsoft App Id and Microsoft App Password are the same in emulator and Web.config file.
- Try with blank Microsoft App Id and Microsoft App Password in both Web.config file and emulator.
- Check if the endpoints on the browser and emulator are the same
- If you are encountering other errors like 401, 405, 500 please check this article.
- In case if all the check points are right and you are still encountering an issue while running the code in emulator, there might be an issue with the code or reference libraries. You can also check the working example.
回答2:
Check your visual studio .bot file. It should be like this.......
{
"name": "EmulatorBot",
"description": "",
"services": [
{
"type": "endpoint",[enter image description here][1]
"endpoint": "http://localhost:3978/api/messages",
"name": "EmulatorBot20181123022900",
"id": "25"
}
],
"padlock": "",
"version": "2.0",
"path": "C:\\Users\\suraj.tiwari\\Desktop\\Bot NK\\EmulatorBot\\EmulatorBot.bot",
"overrides": null
}
Add an Endpoint for your bot
Endpoint url : http://localhost:3978/api/messages
Name : EmulatorBot20181123022900