GemBox Support Forum

Cannot open PDF file in .NET 6 (core) project

I’m trying to open a PDF document in a .NET 6 (core) class library.
But I get an error message:

FileNotFoundException: Could not load file or assembly 'PresentationCore, Version=, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. The system cannot find the file specified.

Running the same code in a .NET Framework console app worked absolutely fine.
Is this expected behaviour? That the recommended Microsoft .NET version is not supported?

Hi Martin,

Yes, that is expected behavior.

The current version of PDF reader in GemBox.Document has WPF dependencies, so you’ll need to enable WPF in your .NET 6 application.

For example, like this:

<Project Sdk="Microsoft.NET.Sdk">


    <PackageReference Include="GemBox.Document" Version="*" />



Hi Mario

I’m using an Azure Function
Any attempts to do this result in the following error from my Azure monitoring logs:

Error: No WPF on the system.

Is it at all possible to achieve this running from an Azure Function, which is my use case
(for reference I’m running this as a .NET 6, v4, Azure function

Unfortunately no, this version of the PDF reader cannot be used on Azure Functions.

Note that we are working on another version that will be able to run on Azure Functions, internally it will be implemented using our GemBox.Pdf component.