Anytime I try and instantiate a class that uses System.Windows.Media I get the following error:
Microsoft.AspNetCore.Components.Server.Circuits.RemoteRenderer: Warning: Unhandled exception rendering component: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
System.IO.FileNotFoundException: Could not load file or assembly 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.
File name: 'PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'
at Report.Pages.MyReport.OnInitialized()
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
Is there a way around this? I'd like to continue using my class library without changing too much.
Makes sense. I went through my library and changed everything over to System.Drawing and created a converter for my WPF projects. Seems to work now. Thanks.
Member
2 Points
9 Posts
Using System.Windows.Media in a Blazor project
Sep 29, 2020 02:39 PM|n0kx1|LINK
Anytime I try and instantiate a class that uses System.Windows.Media I get the following error:
Is there a way around this? I'd like to continue using my class library without changing too much.
All-Star
53661 Points
24020 Posts
Re: Using System.Windows.Media in a Blazor project
Sep 29, 2020 02:56 PM|mgebhard|LINK
The System.Windows.Media is a WPF API. Blazor runs in the browser not a WPF form.
Member
2 Points
9 Posts
Re: Using System.Windows.Media in a Blazor project
Sep 29, 2020 03:23 PM|n0kx1|LINK
Makes sense. I went through my library and changed everything over to System.Drawing and created a converter for my WPF projects. Seems to work now. Thanks.