无法加载文件或程序集 'AdaptiveCards.Html'

Could not load file or assembly 'AdaptiveCards.Html'

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

Could not load file or assembly 'AdaptiveCards.Html' or one of its dependencies. Strong name signature could not be verified. The assembly may have been tampered with, or it was delay signed but not fully signed with the correct private key. (Exception from 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);

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

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