Skip to content
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

[Rendering] WPF render load assembly fail in dotnet 6 framework #8949

Open
lindexi opened this issue Jul 1, 2024 · 0 comments · May be fixed by #8950
Open

[Rendering] WPF render load assembly fail in dotnet 6 framework #8949

lindexi opened this issue Jul 1, 2024 · 0 comments · May be fixed by #8950

Comments

@lindexi
Copy link

lindexi commented Jul 1, 2024

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

https://github.com/microsoft/AdaptiveCards/blob/1243a36a19cb014a8fd638342d0d89657dc33f55/source/dotnet/Library/AdaptiveCards.Rendering.Wpf.Net6/AdaptiveCards.Rendering.Wpf.Net6.csproj#L7C19-L7C51

But the AdaptiveCardRenderer.cs will load the AdaptiveCards.Rendering.Wpf assembly and throw the exception, see

Source = new Uri("/AdaptiveCards.Rendering.Wpf;component/Themes/generic.xaml",

Mini repro step:

  1. Create an empty .NET 6 wpf project.
  2. Install AdaptiveCards.Rendering.Wpf package
  3. 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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant