AdaptiveCards: Incompatibility with bot framework 4.2.0+
Target Platforms
Other
SDK Version
1.4.0
Application Name
all
Problem Description
Since BF was updated to use ANTLR 4.11.1 (in 4.2.0) it is no longer possible to use new AdaptiveCardTemplate(json)
in the same project
It fails with this error:
System.TypeInitializationException: The type initializer for 'AdaptiveCardsTemplateLexer' threw an exception.
---> System.MissingMethodException: Method not found: 'Antlr4.Runtime.Atn.ATN Antlr4.Runtime.Atn.ATNDeserializer.Deserialize(Char[])'.
at AdaptiveCardsTemplateLexer..cctor()
--- End of inner exception stack trace ---
at AdaptiveCardsTemplateLexer..ctor(ICharStream input)
at AdaptiveCards.Templating.AdaptiveCardTemplate..ctor(Object jsonTemplate)
Screenshots
No response
Card JSON
Example, but all fail:
{
"type": "AdaptiveCard",
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"version": "1.5",
"body": [
{
"type": "TextBlock",
"text": "this doesnt work",
"wrap": true
}
]
}
Sample Code Language
C# (dotnet core)
Sample Code
I have created a repro below:
https://github.com/jamesemann/adaptive-cards-incompatibility
If you dotnet run, you will see:
❯ dotnet run
Unhandled exception. System.TypeInitializationException: The type initializer for 'AdaptiveCardsTemplateLexer' threw an exception.
---> System.MissingMethodException: Method not found: 'Antlr4.Runtime.Atn.ATN Antlr4.Runtime.Atn.ATNDeserializer.Deserialize(Char[])'.
at AdaptiveCardsTemplateLexer..cctor()
--- End of inner exception stack trace ---
at AdaptiveCardsTemplateLexer..ctor(ICharStream input)
at AdaptiveCards.Templating.AdaptiveCardTemplate..ctor(Object jsonTemplate)
at Repro.DoesItWork.Main() in C:\repos\templatingrepro\Repro\Repro\Program.cs:line 9
at Repro.DoesItWork.<Main>()
About this issue
- Original URL
- State: closed
- Created a year ago
- Comments: 16 (6 by maintainers)
it’s released.
Thanks a lot @jwoo-msft
Hi @jwoo-msft . The AdpativeExpressions project was updated to use ANTLR 4.11.1 in AdaptiveExpressions 4.20, so both 4.20.0 and 4.20.1 already link to it. See https://www.nuget.org/packages/AdaptiveExpressions/4.20.0. This was the same release of Bot Framework that is causing the incompatibility.
@jamesemann,
I will update SDK to use ANTLR 4.11.1