C# 未使用Bot Framework v4在WebChat中呈现自适应卡操作

C# 未使用Bot Framework v4在WebChat中呈现自适应卡操作,c#,botframework,direct-line-botframework,adaptive-cards,C#,Botframework,Direct Line Botframework,Adaptive Cards,我想在瀑布式对话框中使用自适应卡向用户建议对话框的主要主题。在模拟器中一切正常,但在webchat中不会显示操作按钮 这是自适应卡json: { "type": "AdaptiveCard", "body": [ { "type": "ActionSet", "actions": [ { "type": "Action.Submit", "title": "Matrimonio",

我想在瀑布式对话框中使用自适应卡向用户建议对话框的主要主题。在模拟器中一切正常,但在webchat中不会显示操作按钮

这是自适应卡json:

{
  "type": "AdaptiveCard",
  "body": [
    {
      "type": "ActionSet",
      "actions": [
        {
          "type": "Action.Submit",
          "title": "Matrimonio",
          "id": "matrimonio",
          "data": "Matrimonio"
        },
        {
          "type": "Action.Submit",
          "title": "Carta d'Identità",
          "id": "cartaidetità",
          "data": "Carta d'Identità"
        }
      ]
    }
  ],
  "$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
  "version": "1.0"
}
对话框代码:

public class AnagrafeDialog : CancelAndHelpDialogQnA
    {
        protected readonly ILogger Logger;
        private IQnAService _qnaService;

        public AnagrafeDialog(ILogger<AnagrafeDialog> logger, IQnAService qnAService) : base(nameof(AnagrafeDialog))
        {
            Logger = logger;
            _qnaService = qnAService;


            AddDialog(new TextPrompt(nameof(TextPrompt)));
            AddDialog(new WaterfallDialog(nameof(WaterfallDialog), new WaterfallStep[]
            {
                QuestionStepAsync,
                AnswerStepAsync
            }));

            InitialDialogId = nameof(WaterfallDialog);
        }


        private async Task<DialogTurnResult> QuestionStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            if (FirstIteration)
            {
                var cardAttachment = CreateAdaptiveCardAttachment(Path.Combine(".", "Resources", "AnagrafeArguments.json"));

                var opts = new PromptOptions
                {
                    Prompt = new Activity
                    {
                        Attachments = new List<Attachment>() { cardAttachment },
                        Type = ActivityTypes.Message,
                        Text = "Molto bene. Sono pronto a parlati dell'ufficio anagrafe, ad oggi posso rispondere alle tue domande in merito a due argomenti, il matrimonio e la Carta d'Identià. Fammi qualche domanda oppure clicca su uno dei pulsanti qui sotto.",
                    }
                };
                FirstIteration = false;

                return await stepContext.PromptAsync(nameof(TextPrompt), opts);
            }


            var messageText = stepContext.Options?.ToString() ?? "";
            var promptMessage = MessageFactory.Text(messageText, messageText, InputHints.ExpectingInput);

            return await stepContext.PromptAsync(nameof(TextPrompt), new PromptOptions { Prompt = promptMessage }, cancellationToken);
        }

        private async Task<DialogTurnResult> AnswerStepAsync(WaterfallStepContext stepContext, CancellationToken cancellationToken)
        {
            string query = stepContext.Result.ToString();
            var qnaResult = await _qnaService.QueryAnagrafeQnAServiceAsync(query, new QnABotState());

            return await AnswerResultControlAsync(stepContext, qnaResult, cancellationToken);
        }

        private static Attachment CreateAdaptiveCardAttachment(string filePath)
        {
            var adaptiveCardJson = File.ReadAllText(filePath);
            var adaptiveCardAttachment = new Attachment()
            {
                ContentType = "application/vnd.microsoft.card.adaptive",
                Content = JsonConvert.DeserializeObject(adaptiveCardJson),
            };
            return adaptiveCardAttachment;
        }
    }
public类AnagrafeDialog:CancelAndHelpDialogQnA
{
受保护的只读ILogger记录器;
私人IQnAService(qnaService),;
公共AnagrafeDialog(ILogger)


这是上的结果。

这与以下两个问题有关:

动作集在WebChat atm中没有正确呈现,但是在第二期评论中有一个解决方法