microsoft / microsoft/AdaptiveCards
[Rendering] WPF render load assembly fail in dotnet 6 framework
Nobody has claimed this yet.
- Dominant language
- C#
- Stars
- 2k
- Forks
- 595
- Avg merge
- 1d 19h
- Merged PRs (30d)
- 1
Description
Target Platforms
WPF
SDK Version
2.8.0
Application Name
Any
Problem Description
Calling adaptiveCardRenderer.RenderCard will throw an exception in dotnet 6:
System.IO.FileNotFoundException:“Could not load file or assembly 'AdaptiveCards.Rendering.Wpf, Culture=neutral, PublicKeyToken=null"
Why? Because AssemblyName of the dotnet 6 version is AdaptiveCards.Rendering.Wpf.Net6, see
But the AdaptiveCardRenderer.cs will load the AdaptiveCards.Rendering.Wpf assembly and throw the exception, see
Mini repro step:
- Create an empty .NET 6 wpf project.
- Install AdaptiveCards.Rendering.Wpf package
- Add the code in MainWindow.xaml.cs
var adaptiveCardRenderer = new AdaptiveCardRenderer(new AdaptiveHostConfig()
{
});
var adaptiveCard = new AdaptiveCard(new AdaptiveSchemaVersion(1,0));
adaptiveCard.Body.Add(new AdaptiveTextBlock()
{
Text = "Hello",
Size = AdaptiveTextSize.ExtraLarge
});
var json = adaptiveCard.ToJson();
var result = adaptiveCardRenderer.RenderCard(adaptiveCard);
You can find my demo code in : https://github.com/lindexi/lindexi_gd/tree/e00981126d6c0d56aee41d9142e6b944d42b0a2a/WPFDemo/LaifearwheafoWhemhaldaycearai
Screenshots
No response
Card JSON
{}
Sample Code Language
C#
Sample Code
No response
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with source/dotnet/Library/AdaptiveCards.Rendering.Wpf.Net6/AdaptiveCards.Rendering.Wpf.Net6.csproj and AdaptiveCardRenderer.cs around the assembly load noted in the issue. Reproduce the failure in an empty .NET 6 WPF project using the provided code, then verify that installing AdaptiveCards.Rendering.Wpf and calling RenderCard completes without the FileNotFoundException.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- csharp
- Domain
- desktop
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100