Why does HeroCard work in BotEmulator but not in Web Chat?

17 Views Asked by At

I have the following HeroCard function that I use to display information to the user with

 private static async void ShowUseCaseInfo(ITurnContext turnContext, UseCase useCase, CancellationToken cancellationToken)
 {
     var card = new HeroCard
     {
         Title = useCase.UseCaseName,
         Text = useCase.Description,
         Subtitle = "Owner: " + useCase.Owner,
         Buttons = new List<CardAction> {
             new CardAction(ActionTypes.OpenUrl, "Contact Owner", value: "mailto:" + useCase.Owner)
         }
     };

     var attachment = card.ToAttachment();
     var reply = MessageFactory.Attachment(attachment);

     // Send the information card as the reply
     try
     {
         await turnContext.SendActivityAsync(reply, cancellationToken);
     }
     catch (Exception ex)
     {
         // Log the exception to identify the issue
         Console.WriteLine($"ERROR on Info Card: {ex.Message}");
     }
 }

The HeroCard shows well in Bot Framework but not in the Azure Web Chat. What could be the problem ?? Please help

0

There are 0 best solutions below