I cannot seem to connect to my application running on localhost from visual studio using the Bot Emulator(v3.5). I keep getting the error "connect ECONNREFUSED" even when the application is started.
Can anyone help?
Hi @chuksogbolime, I can help troubleshoot. A few questions:
http://localhost:3978/api/messages?I have the same issue.
Here is the Log:
[02:40:15] Application is up to date.
[02:40:43] -> POST connect ECONNREFUSED 127.0.0.1:3978
The bot endpoint is: http://localhost:3978/api/messages
I have tried this with and without MSA. Also turned off all firewalls.
Observation:
When I use the VS template and run the bot, the emulator doesn't work.
But, when the build and run the Echo Bot sample, the emulator works.
Log:
[02:56:40] Application is up to date.
[02:59:18] -> POST connect ECONNREFUSED 127.0.0.1:3978
[03:02:43] <- POST 200 Reply[message] Welcome User /* Connected to echobot running on port 53318*/
[03:02:44] <- POST 200 Reply[message] Welcome User!
[03:02:44] -> POST 202 [conversationUpdate]
[03:03:17] <- POST 200 Reply[message] 1: You said hello
[03:03:18] -> POST 202 [message] hello
I have been able to get around this issue. I think the problem was with the visual studio template version I installed. I have updated it to 3.4.0 and used it to build a sample Bot Application and it works fine.
@chuksogbolime Can you please share the link/ resource from where I can get the 3.4.0 template. Thanks!
~abhishan
@abhishan, you will need to delete the template file placed in the c# template directory as directed by the documentation and then install the template (Bot_Application) directly from visual studio created by Yowko Tsai.
@abhishan, here is a link I found https://www.nuget.org/packages/Microsoft.Bot.Builder/
This issue appears to be resolved. Closing it now. If I'm incorrect, please let me know and I will reopen.
I am having the same problem with version 3.5 of the bot builder framework. Is there another version of the template? I create a project from scratch using 3.5 of the framework and used the controller from the template but I still have the same issue - econnrefused .
After also seeing this [https://github.com/Microsoft/BotFramework-Emulator/issues/58] I changed the port of my bot project to 3978 and all was well.
same here!
----------------------------- UPDATE PEBCAC -------------------------
When starting the Bot Service, wait for the browser to open and check if you are indeed using the correct port! My bot was then running on 3979. Once i changed that the Emulator worked out of the box.
I followed the instruction over here : https://docs.microsoft.com/en-us/bot-framework/nodejs/bot-builder-nodejs-quickstart
But it didn't work. Its giving me the error : POST connect ECONNREFUSED 127.0.0.1:3978
URL is http://localhost:3978/api/messages
This is happening in the botframework-emulator. Have used ngrok aslo.
Any idea why this is happening?
Had faced a couple of issues while trying to get the bot emulator connect to my bot application on localhost but finally was able to make a connection. Here is how -
Note: As per the installed template, I was using Microsoft.Bot.Builder version 3.0.0 and this produced a warning message in the bot emulator but it still worked. As per the recommendation (>=3.5.0), I updated it to 3.5.1.
You can also add breakpoints in your code and debug the code using this process.
Hope this helps!
Thanks,
Clyde
Most helpful comment
same here!
----------------------------- UPDATE PEBCAC -------------------------
When starting the Bot Service, wait for the browser to open and check if you are indeed using the correct port! My bot was then running on 3979. Once i changed that the Emulator worked out of the box.