Bot Framework - Adaptive Card - Can't render card in Direct Line












-2















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










share|improve this question




















  • 4





    Welcome to stackoverflow. Please take a minute to take the tour, especially How to Ask, and edit your question accordingly.

    – JohnB
    Nov 15 '18 at 8: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
















-2















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










share|improve this question




















  • 4





    Welcome to stackoverflow. Please take a minute to take the tour, especially How to Ask, and edit your question accordingly.

    – JohnB
    Nov 15 '18 at 8: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














-2












-2








-2








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










share|improve this question
















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







c# chat botframework bots adaptive-cards






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 15 '18 at 11:29









SHR

6,03572442




6,03572442










asked Nov 15 '18 at 8:16









LubomirLubomir

414




414








  • 4





    Welcome to stackoverflow. Please take a minute to take the tour, especially How to Ask, and edit your question accordingly.

    – JohnB
    Nov 15 '18 at 8: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














  • 4





    Welcome to stackoverflow. Please take a minute to take the tour, especially How to Ask, and edit your question accordingly.

    – JohnB
    Nov 15 '18 at 8: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








4




4





Welcome to stackoverflow. Please take a minute to take the tour, especially How to Ask, and edit your question accordingly.

– JohnB
Nov 15 '18 at 8:22





Welcome to stackoverflow. Please take a minute to take the tour, especially How to Ask, and edit your question accordingly.

– JohnB
Nov 15 '18 at 8:22




1




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





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







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





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 Answer
1






active

oldest

votes


















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 ;





share|improve this answer























    Your Answer






    StackExchange.ifUsing("editor", function () {
    StackExchange.using("externalEditor", function () {
    StackExchange.using("snippets", function () {
    StackExchange.snippets.init();
    });
    });
    }, "code-snippets");

    StackExchange.ready(function() {
    var channelOptions = {
    tags: "".split(" "),
    id: "1"
    };
    initTagRenderer("".split(" "), "".split(" "), channelOptions);

    StackExchange.using("externalEditor", function() {
    // Have to fire editor after snippets, if snippets enabled
    if (StackExchange.settings.snippets.snippetsEnabled) {
    StackExchange.using("snippets", function() {
    createEditor();
    });
    }
    else {
    createEditor();
    }
    });

    function createEditor() {
    StackExchange.prepareEditor({
    heartbeatType: 'answer',
    autoActivateHeartbeat: false,
    convertImagesToLinks: true,
    noModals: true,
    showLowRepImageUploadWarning: true,
    reputationToPostImages: 10,
    bindNavPrevention: true,
    postfix: "",
    imageUploader: {
    brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
    contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
    allowUrls: true
    },
    onDemand: true,
    discardSelector: ".discard-answer"
    ,immediatelyShowMarkdownHelp:true
    });


    }
    });














    draft saved

    draft discarded


















    StackExchange.ready(
    function () {
    StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53315014%2fbot-framework-adaptive-card-cant-render-card-in-direct-line%23new-answer', 'question_page');
    }
    );

    Post as a guest















    Required, but never shown

























    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    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 ;





    share|improve this answer




























      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 ;





      share|improve this answer


























        0












        0








        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 ;





        share|improve this answer













        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 ;






        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 21 '18 at 6:26









        Tushar VajaTushar Vaja

        615




        615
































            draft saved

            draft discarded




















































            Thanks for contributing an answer to Stack Overflow!


            • Please be sure to answer the question. Provide details and share your research!

            But avoid



            • Asking for help, clarification, or responding to other answers.

            • Making statements based on opinion; back them up with references or personal experience.


            To learn more, see our tips on writing great answers.




            draft saved


            draft discarded














            StackExchange.ready(
            function () {
            StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53315014%2fbot-framework-adaptive-card-cant-render-card-in-direct-line%23new-answer', 'question_page');
            }
            );

            Post as a guest















            Required, but never shown





















































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown

































            Required, but never shown














            Required, but never shown












            Required, but never shown







            Required, but never shown







            Popular posts from this blog

            Florida Star v. B. J. F.

            Danny Elfman

            Lugert, Oklahoma