Search code examples
c#.net-corebotframeworkbots

Why ConversationReference service url is different than localhost?


I'm using the Microsoft Bot Framework V4. When i use the code following bellow

    public async Task OnTurnAsync(ITurnContext context, NextDelegate next, CancellationToken cancellationToken = default(CancellationToken))
    {

        var conversationReference = context.Activity.GetConversationReference();
        System.Console.Write(conversationReference.ServiceUrl);

    }

The value printed is http://localhost:62304 but the app is running on this address http://localhost:4353/api/messages

Is there a difference between this addresses? Is there a way they have the same value?

Thanks in advance


Solution

  • I assume you are using the emulator. The localhost:62304 is the emulated direct line service. You don't want them to be the same value. Your bots endpoint, and the directline service are two different things, and neither will be localhost (obviously) once your bot is published and connected to channels.

    Is there an problem that this is causing?