botframework-sdk: "An error occurred while sending the request" from emulator

Is there a problem with Microsoft.Bot.builder v1.2.3?

I did the following:

  • installed VS2015 Community Edition
  • installed Microsoft Bot Emulator
  • downloaded and installed the template for bots
  • Created a new project based on the bot template
  • Updated the Bot.Connector
  • Copied and pasted the full example of the alarm bot to MessageController.cs

At that, trying to build fails. If I install the bot.builder v1.2.3, it builds, and I get the webpage:

Bot_Application1

Describe your bot here and your terms of use etc.

Visit Bot Framework to register your bot. When you register it, remember to set your bot's endpoint to 
https://your_bots_hostname/api/messages

I cannot connect though. I connect the emulator to either https://localhost/api/messages or http://localhost/api/messages, but both give me the error above.

The JSON in the window after the emulator returns “an error occurred while sending the request” is

System.Net.Http.HttpRequestException: An error occurred while sending the request. ---> System.Net.WebException: Unable to connect to the remote server ---> System.Net.Sockets.SocketException: No connection could be made because the target machine actively refused it 127.0.0.1:443
   at System.Net.Sockets.Socket.EndConnect(IAsyncResult asyncResult)
   at System.Net.ServicePoint.ConnectSocketInternal(Boolean connectFailure, Socket s4, Socket s6, Socket& socket, IPAddress& address, ConnectSocketState state, IAsyncResult asyncResult, Exception& exception)
   --- End of inner exception stack trace ---
   at System.Net.HttpWebRequest.EndGetRequestStream(IAsyncResult asyncResult, TransportContext& context)
   at System.Net.Http.HttpClientHandler.GetRequestStreamCallback(IAsyncResult ar)
   --- End of inner exception stack trace ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Microsoft.Bot.Connector.Emulator.ConversationModel.<SendMessageAsync>d__50.MoveNext()

About this issue

  • Original URL
  • State: closed
  • Created 8 years ago
  • Reactions: 1
  • Comments: 16 (3 by maintainers)

Most upvoted comments

Argh, this was totally my fault. I added the ability to change the port and inadvertently pushed a version which never started the service! I will have a new build pushed out within an our (as soon as I can get the binaries signed.)

The good news is that I have added the ability for people to change port, and I also detect the corrupted file problem and robustly handle that.

I am sooo sorry for wasting your time on this…If I could I would buy you a beer to make up for it!

Same here, also in combination with LUIS. The problem seems to be in the connector back to the emulator, stacktrace reveals this inner exception:

No connection could be made because the target machine actively refused it 127.0.0.1:9000

Could maybe not be the bot framework, but the emulator instead. But I have no clue on how to revert back to a previous version since that comes from online?

Thanks Tomlm, sounds promising. Which component should I be looking out for?

Having the same problem here all of the sudden. Code that was working before the emulator update now fails with a message similar to the issue reported above. “No connection could be made because the target machine actively refused it 127.0.0.1:9000”. I rolled the emulator back to 1.0.0.66 through Control Panel, Programs and Features and the issue no longer occurs.