Error in .NET Core converted project

2 Answers 825 Views
General Discussions
Herald
Top achievements
Rank 1
Veteran
Iron
Herald asked on 14 Nov 2021, 12:11 AM

Hello 

I did manually converted a .NET Framework 4.7.2 to .NET Core 5.0. I did the conversion by editing the .csproj files using Sdk format.

I have Telerik WPF libraries (2021.3.914) installed locally, and the project refers to the local DLLs.

I don't get any design-time error. I can even see the preview  of the page and controls in the designer. 

When I run the app I get a runtime error.

 

System.TypeInitializationException: 'The type initializer for 'Telerik.Windows.Controls.TelerikLicense' threw an exception.'

MissingMethodException: Method not found: 'System.ActivationContext System.AppDomain.get_ActivationContext()'.

 

I have two projects running side by side: the .NET Framework 4.7.2 runs fine, .NET Core 5.0 fails.

 

Thanks

Herald

 

 

2 Answers, 1 is accepted

Sort by
0
Accepted
Herald
Top achievements
Rank 1
Veteran
Iron
answered on 17 Nov 2021, 02:59 PM

As a matter of fact, this was the problem. I was by mistake trying to load the .Net Framework dlls into the .NET Core project. 

The way I fixed it was that I create a local NuGet source poiting to the local Telerik folder and let the solution pick up the correct version if the dlls.

Thanks

Herald

0
Dilyan Traykov
Telerik team
answered on 17 Nov 2021, 01:09 PM

Hello Herald,

Thank you for the provided image.

Such an error can occur if the incorrect version of the Telerik assemblies is referenced by the project.

For a .NET 5.0 application, you need to reference the binaries from the Binaries/WPF50 folder of your Telerik UI for WPF installation. You can check whether the version of all of the referenced assemblies is 2021.3.914.50.

As some caching may be taking place, even if the references do point to this folder, can you please try to manually replace them and see if the issue persists?

If that is the case, please send over a small sample project which demonstrates the error so that I can further investigate and assist you.

Regards,
Dilyan Traykov
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Blazor course! Check it out at https://learn.telerik.com/.

Tags
General Discussions
Asked by
Herald
Top achievements
Rank 1
Veteran
Iron
Answers by
Herald
Top achievements
Rank 1
Veteran
Iron
Dilyan Traykov
Telerik team
Share this question
or