Botframework 自适应卡显示不显示在cortana通道上,但在团队和模拟器上运行良好

Botframework 自适应卡显示不显示在cortana通道上,但在团队和模拟器上运行良好,botframework,cortana,adaptive-cards,cortana-skills-kit,Botframework,Cortana,Adaptive Cards,Cortana Skills Kit,我创建了一个QnA机器人,并将cortana与之集成。 我可以在cortana频道上看到英雄卡,但不能看到自适应卡。 虽然我在代码中的reply变量中获得了附件,但卡没有呈现。 此外,自适应卡的speak属性似乎已被弃用 下面是我作为调试信息得到的json响应 { "botId": "ValoremReplyCortanaBot", "botRequest": { "type": "message", "id": "ru2O3ASCqo", "timestamp"

我创建了一个QnA机器人,并将cortana与之集成。 我可以在cortana频道上看到英雄卡,但不能看到自适应卡。 虽然我在代码中的reply变量中获得了附件,但卡没有呈现。 此外,自适应卡的speak属性似乎已被弃用

下面是我作为调试信息得到的json响应

{
  "botId": "ValoremReplyCortanaBot",
  "botRequest": {
    "type": "message",
    "id": "ru2O3ASCqo",
    "timestamp": "2019-05-28T12:28:38.6194349Z",
    "serviceUrl": "https://CortanaBFChannelEastUs.azurewebsites.net/",
    "channelId": "cortana",
    "from": {
      "id": "6E45EE54844A79A85857DE2CEF10B9223A16AE6ACC2360DC007744F9CA7377E5"
    },
    "conversation": {
      "id": "f002bf89-2d89-4e41-a5b6-bcdfa4e35cc3"
    },
    "recipient": {
      "id": "valoremreplycortanabot"
    },
    "locale": "en-US",
    "text": "guide",
    "entities": [
      {
        "type": "Intent",
        "name": "None",
        "entities": []
      },
      {
        "type": "AuthorizationToken",
        "token": "##",
        "status": 0
      },
      {
        "type": "UserInfo",
        "current_location": {
          "StartTime": "2019-05-28T12:28:38.0673147Z",
          "EndTime": null,
          "Hub": {
            "Id": null,
            "Type": "Other",
            "Name": null,
            "Latitude": 10.0126075744629,
            "Longitude": 76.3658599853516,
            "Address": null
          },
          "VenueName": null,
          "Away": false
        },
        "name": {
          "GivenName": "##",
          "FamilyName": "##"
        },
        "email": "##@outlook.com"
      },
      {
        "type": "DeviceInfo",
        "supportsDisplay": "true"
      }
    ],
    "channelData": {
      "skillId": "cc3ef598-4f4f-444f-bd20-87a211581607",
      "skillProductId": "188779dd-2894-4cb3-b93f-b99955039ead",
      "isDebug": true
    }
  },
  "botResponse": {
    "type": "message",
    "timestamp": "2019-05-28T12:28:51.306281Z",
    "serviceUrl": "https://CortanaBFChannelEastUs.azurewebsites.net/",
    "channelId": "cortana",
    "from": {
      "id": "valoremreplycortanabot"
    },
    "conversation": {
      "id": "f002bf89-2d89-4e41-a5b6-bcdfa4e35cc3"
    },
    "recipient": {
      "id": "6E45EE54844A79A85857DE2CEF10B9223A16AE6ACC2360DC007744F9CA7377E5"
    },
    "locale": "en-US",
    "text": "",
    "attachments": [
      {
        "contentType": "application/vnd.microsoft.card.adaptive",
        "content": {
          "type": "AdaptiveCard",
          "version": "1.0",
          "body": [
            {
              "type": "TextBlock",
              "size": "large",
              "weight": "bolder"
            },
            {
              "type": "Image",
              "size": "stretch",
              "url": "##",
              "width": "100px",
              "height": "100px"
            }
          ],
          "actions": [
            {
              "type": "Action.OpenUrl",
              "url": "##",
              "title": "Guide Poster",
              "speak": "Guide Poster"
            }
          ]
        }
      }
    ],
    "entities": [],
    "replyToId": "ru2O3ASCqo"
  }
}

Cortana desktop中的HTML呈现程序不如其他客户端那么宽容。检查

确保每个元素都有其必需的字段

它可以像您的TextBlock没有文本对象一样简单。。。。添加
“文本”:“


哦,说英语并不是不受欢迎的。这是在一个卡的水平;对等体。而且。。。默认情况下,Cortana不会说。您需要从卡中复制它并将其添加到消息中

谢谢,确保所有必填字段都有一些适用于我的值。var cardContent=CardMaker.SubstituteAdaptiveCard(qnaAnswer.title,qnaAnswer.subtitle,null,cardImages,cardActions);附件附件=新附件(){ContentType=AdaptiveCard.ContentType,Content=cardContent};string speak=(string)((JObject)attachment.Content);粗体部分给出的错误是“无法将'AdaptiveCard.AdaptiveCard'类型的对象强制转换为'Newtonsoft.Json.Linq.JObject'。”您当前的强制转换错误,这是因为您正在使用不同的“代理”对象来实现自适应卡,然后是示例。将此创建为一个新问题?代理类在获取speak属性方面可能有更好的方法。我用的是1.0.6(我想)。