.NET Libraries for card creation

As we described in the Getting Started, an adaptive card is nothing more than a serialized JSON object of a card object model. To make it easy to manipulate the object model, we defined libraries which define a strongly-typed class hierarchy that makes it easy to serialize/deserialize JSON.

You can use any tooling that you want to create the adaptive card JSON.


The Microsoft.AdaptiveCards nuget package defines a class hierachy for working with adaptive cards in .NET

To install

nuget install Microsoft.AdaptiveCards 

Example: create

var card = new AdaptiveCard();
card.Body.Add(new TextBlock() 
    Text = "Hello",
    Size = TextSizes.ExtraLarge,
    Color = TextColor.Attention
card.Body.Add(new Image() 
    Url = "http://someUrl.com/example.png"

Example: save using JSON.NET

var json = JsonConvert.SerializeObject(card);

Example: load using JSON.NET

var card = JsonConvert.DeserializeObject<AdaptiveCard>(json);