-
Notifications
You must be signed in to change notification settings - Fork 563
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adaptive cards not working with latest nuget update in .Net #9117
Comments
@mkauroaktreecapital - Could you please share a video of the error that you're getting. Could you please confirm if you are facing this issue even when the card is sent through Developer portal. |
@Meghana-MSFT Does this bug fall to Teams? I am not able to repro on our visualizer; however, I'd need more information on the |
@anna-dingler - Question author mentioned Microsoft Teams in Application name, however I tried to send the card through developer portal in Teams and it worked. |
Yes, we are getting this issue from developer portal as well. Card is not rendering if I paste the cardJson which is created through code after template.Expand(). And we can see formatDateTime function not expanding properly due to which error occurs. |
Sample CalendarMeetingInfo object json that is used to fill data in card is below: string cardJson = template.Expand(meetingInfoState); In cardJson that we get after expanding the template we can see formatDateTime function as is, which is wrong. It should be able to read the startTime and convert it to HH:mm and then assign its value. This works fine with older nuget versions. Issue is with new version. |
Target Platforms
Other
SDK Version
AdaptiveCards=3.1.0
AdaptiveCards.Templating=2.0.4
Application Name
Microsoft Teams and Bot Emulator
Problem Description
Adaptive cards started throwing exceptions with latest nuget in .Net in emulator and teams channel. It works fine with previous version of nugets, but with latest it gives error.
Old version (working fine):
AdaptiveCards=2.7.1
AdaptiveCards.Templating=1.2.1
Latest version (Throwing error for same cards)
AdaptiveCards=3.1.0
AdaptiveCards.Templating=2.0.4
There are multiple cards failing because of this.
Screenshots
No response
Card JSON
Sample Code Language
.NET
Sample Code
try
{
var card = "EventScheduleDirectLine.json";
if (isMsTeamsChannel)
{
card = "EventSchedule.json";
}
var fileRead = System.IO.File.ReadAllText(Path.Combine(".", "Cards", card));
AdaptiveCardTemplate template = new AdaptiveCardTemplate(fileRead);
meetingInfoState = new CalendarMeetingInfo { YearList = new List() };
for (int i = DateTime.Now.Year; i <= DateTime.Now.Year + 1; i++)
{
int counter = 1;
meetingInfoState.YearList.Add(new Years
{
Year = i.ToString()
});
counter++;
}
meetingInfoState.Year = "";
}
catch (Exception ex)
{
return null;
}
The text was updated successfully, but these errors were encountered: