1

在升级到机器人版本 v3.8 并从 Nuget 包管理器安装自适应卡后,我构建了我的机器人解决方案。一切正常,但是当我使用 ngrok 公开我的本地地址时,出现错误:

无法加载文件或程序集“AdaptiveCards.Html”或其依赖项之一。无法验证强名称签名。该程序集可能已被篡改,或者它被延迟签名但未使用正确的私钥完全签名。(来自 HRESULT 的异常:0x80131045)

代码 :

                    AdaptiveCard card = new AdaptiveCard();
                    card.Speak = "hellooooooo";

                    card.Body.Add(new TextBlock()
                    {
                        Text = "Adaptive Card design session",
                        Size = TextSize.Large,
                        Weight = TextWeight.Bolder
                    });

                    // Add text to the card.
                    card.Body.Add(new TextBlock()
                    {
                        Text = "Conf Room 112/3377 (10)"
                    });

                    // Add text to the card.
                    card.Body.Add(new TextBlock()
                    {
                        Text = "12:30 PM - 1:30 PM"
                    });

                    // Add list of choices to the card.
                    card.Body.Add(new ChoiceSet()
                    {
                        Id = "snooze",
                        Style = ChoiceInputStyle.Compact,
                        Choices = new List<Choice>()
    {
        new Choice() { Title = "5 minutes", Value = "5", IsSelected = true },
        new Choice() { Title = "15 minutes", Value = "15" },
        new Choice() { Title = "30 minutes", Value = "30" }
    }
                    });

                    // Add buttons to the card.
                    card.Actions.Add(new HttpAction()
                    {
                        Url = "http://foo.com",
                        Title = "Snooze"
                    });

                    card.Actions.Add(new HttpAction()
                    {
                        Url = "http://foo.com",
                        Title = "I'll be late"
                    });

                    card.Actions.Add(new HttpAction()
                    {
                        Url = "http://foo.com",
                        Title = "Dismiss"
                    });

                    // Create the attachment.
                    Attachment attachment = new Attachment()
                    {
                        ContentType = AdaptiveCard.ContentType,
                        Content = card
                    };


                    message.Attachments.Add(attachment);
                    await context.PostAsync(message);
4

1 回答 1

2

您使用的是 .NET Standard 并且升级了吗?

我们刚刚发布了一个新版本的包,它将 .NET Standard 要求从 1.6 降低到 1.3。我想知道是否存在混乱的绑定重定向。您可以尝试卸载然后重新安装。

于 2017-05-21T06:32:53.217 回答