question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[WPF][Rendering/Templating] Renderer throws newtonsoft error

See original GitHub issue

Platform

What platform is your issue or question related to? (Delete other platforms).

  • .NET WPF

Author or host

Host, trying to render a card in my own app (visual studio extension)

Version of SDK

AdaptiveCards.Rendering.Wpf -> 1.2.3 AdaptiveCards.Rendering.Wpf.Xceed -> 1.2.3 AdaptiveCards.Templating -> v0.1.0-alpha1

Details

When trying to use the designer (vnext version) its all fine, designer renders the card+template correctly. Things are not working only with WPF renderer.

Keep getting this exception: System.InvalidOperationException: ‘Current error context error is different to requested error.’ during a call to : AdaptiveCard.FromJson(cardJson).Card;

This is my code: var transformer = new AdaptiveTransformer(); var cardJson = transformer.Transform(templateData, taskData); AdaptiveCard card = AdaptiveCard.FromJson(cardJson).Card;

Find attached card template and the card data, data-binding works fine tho.

taskCardSampleData.txt taskCard.txt

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:10 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
DeeJayTCcommented, Oct 10, 2019

Thanks for asking for that…found the issue. While looking at the transformed data i realized that one of the urls was "text": " [undefined](https://digitalcrew.teamwork.com/people/undefined) ( Teamwork )", In the template i accidently used $root instead of $data. Its working now after i changed that.

Only weird thing is that the designer on https://vnext.adaptivecards.io/designer/ renders it just fine while the WPF one throws that error.

0reactions
jonmillcommented, Nov 18, 2021

Tracked by #1984

Read more comments on GitHub >

github_iconTop Results From Across the Web

JsonConvert.DeserializeObject throwing error after adding ...
The problem is as described in the error message: Json.NET is unable to choose a constructor for ValidationResult because it has two public ......
Read more >
Error in Experience Editor when Saving Rendering with ...
When I debug I get the following error in Visual Studio: System.Web.HttpRequestValidationException occurred Message: Exception thrown: 'System.
Read more >
Build fails when multiple Newtonsoft.Json.dll files are included ...
Build fails when multiple Newtonsoft.Json.dll files are included in the project · 1. Open the attached project's "case_1291253-Project.zip" · 2.
Read more >
Serialization Error Handling
The Error event is an event handler found on JsonSerializer. The error event is raised whenever an exception is thrown while serializing or...
Read more >
Newtonsoft JSON not working on build (ANDROID)
Hello, i'm currently working with Unity 3D (Unity 2021.2.8f1) and want to create an Application for Android. So far everything was working ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found