-1

I have created an Adaptive card which unfortunately is not showed in a Direct Line chat form. Whenever tested in the the web chat in Azure it is working properly.

You can see the error message that I get in the picture below.

The form works properly with HeroCards.

Adaptive Card Not Displayed

Adaptive Card Not Displayed

Community
  • 1
  • 1
Lubomir
  • 91
  • 8
  • 4
    Welcome to stackoverflow. Please take a minute to take the [tour], especially [ask], and [edit] your question accordingly. – jazb Nov 15 '18 at 08:22
  • 1
    What do you mean by a Direct Line chat form? Is this Web Chat or your own Direct Line client? This looks like it's probably a problem with versions. Most clients can't render Adaptive Cards v1.1, and that's exactly what I'd expect to see if that's what's happening. Can you check to see what version of Adaptive Cards your bot is using and what version of Adaptive Cards your Direct Line client supports? – Kyle Delaney Nov 15 '18 at 18:36
  • Fixed: Had to manually put the version of the Adaptive Card. adaptiveCard.Version = "1.0"; – Lubomir Nov 21 '18 at 14:34
  • I'm glad your issue was resolved. Would you like to post your solution and mark it as correct or would you like me to reword my comment as an answer so you can mark that as correct? – Kyle Delaney Nov 21 '18 at 19:34

1 Answers1

0

Are you using Adaptive card SDK while creating adaptive card? If yes, try using content type string as below instead ContentType = card.Type. This worked for me.

AdaptiveCard card = new AdaptiveCard();

// put you code to create card

Attachment attachment = new Attachment()
{
    ContentType = "application/vnd.microsoft.card.adaptive",       
    Content = card
};
return  attachment ;