I am not sure about the nuget package to be included for the adaptive cards in version 4 bot application which is being migrated from version 3. The options available are AdaptiveCards nuget package and Microsoft.AdaptiveCards(both by Microsoft). In version 3 we had adaptiveCards(by AdaptiveCards) which we were using.
We were using the following nuget package for adaptive cards(by AdaptiveCards) Adaptive cards in our version 3 application, kindly help me with the nuget package to be used for version 4 of same application so that the changes to be done in the existing code could be minimal and time saving.
When I add the suggested package in v4 aplication and the adaptive cards methods, I get the error 'AdaptiveCards is obselete. Please use the overload that accepts the version parameter and specify the version your card requires.'
One of the methods from our Adaptive Cards Class:
//Create an adaptive card to show the SharePoint search result
public static Attachment SPSearchAdapativecard(string title, string summery, string actionUrl)
{
summery = summery.Replace("<c0>", "**");
summery = summery.Replace("</c0>", "**");
summery = summery.Replace("<ddd/>", "...");
AdaptiveCard card = new AdaptiveCard()
{
Body = new List<AdaptiveElement>()
{
new AdaptiveTextBlock()
{
Text = title,
Weight = AdaptiveTextWeight.Bolder,
Size = AdaptiveTextSize.Medium,
Wrap=false,
Separator = false,
Color= AdaptiveTextColor.Accent
},
new AdaptiveTextBlock()
{
Text = summery,
Wrap=true,
Size = AdaptiveTextSize.Small
},
},
Actions = new List<AdaptiveAction>()
{
new AdaptiveOpenUrlAction()
{
Id = "moreInfoBtn",
Title= "More Info",
Url= new Uri(actionUrl)
}
}
};
// Create the attachment with adapative card.
Attachment attachment = new Attachment()
{
ContentType = AdaptiveCard.ContentType,
Content = card
};
return attachment;
}