Last Updated: 20 Sep 2021 11:51 by ADMIN
Created on: 11 Mar 2020 17:25
Category: Telerik Document Processing
Type: Bug Report
.NET core 3.1 Document Processing

I'm trying to use RadWordsProcessing

to replace text in .docx documents.

when i try to open a document i have an error:

BadImageFormatException: Could not load file or assembly 'PresentationCore, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Reference assemblies should not be loaded for execution.  They can only be loaded in the Reflection-only loader context. (0x80131058)

Attached Files:
1 comment
Posted on: 12 Mar 2020 11:54

Hello Pedro,

The .NET Core project should reference the PresentationCore assembly as well. However, in .Net Core, you cannot directly reference it and you need to add the Microsoft.WindowsDesktop.App.WPF package. For example, this will work if you call this from a WPF application (see attached). UnfortunatelyMicrosoft.WindowsDesktop.App this package is not compatible with console applications and can not be added.   

What I can suggest is to migrate the Docs project to .Net Core as well. We have a separate set of assemblies that are built especially for .Net Core and you can use them instead. The difference is that they do not have the word Windows in their name and they do not depend on the operating system. They are available as NuGet packages: NuGet packages.

Let me know if you have any other questions.

Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Attached Files: