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

Missing dependencies #242

Open
Marcus-Sie opened this issue Feb 25, 2025 · 6 comments
Open

Missing dependencies #242

Marcus-Sie opened this issue Feb 25, 2025 · 6 comments
Labels
Cannot Reproduce https://xkcd.com/583/ forum Please use Discussions or the Support forum to ask Support questions - https://forum.pdfsharp.net/ support

Comments

@Marcus-Sie
Copy link

With update 6.2.0-preview-3 I get runtime exception.
At this line
using (PdfDocument pdfd = new PdfDocument())

I get the exception.

System.IO.FileNotFoundException: 'Could not load file or assembly 'Microsoft.Extensions.Logging.Abstractions, Version=8.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60' or one of its dependencies. Das System kann die angegebene Datei nicht finden.'

I already made a new installation of all dependencies and the PDFsharp Migradoc.

How can I solve this issue?

@ThomasHoevel
Copy link
Member

Version 6.2.0 Preview 3 was released on February 6, 2025.
In your app folder, all PDFsharp and all MigraDoc DLL files should have that date and file version 6.2.0.7341.

Version 6.2.0 Preview 3 references version 8.0.1 of the Microsoft logging packages which in turn references version 8.0.2 of the logging abstractions.
I don't know why your app tries to load version 8.0.0 which is no longer used by Preview 3.

One guess: Maybe you have some older files in your app folder.
It may help to add a reference to PDFsharp 6.2.0 Preview 3 to your projects.

@ThomasHoevel ThomasHoevel added support Cannot Reproduce https://xkcd.com/583/ forum Please use Discussions or the Support forum to ask Support questions - https://forum.pdfsharp.net/ labels Feb 27, 2025
@Marcus-Sie
Copy link
Author

Hello Thomas,
I tried many things but sill no success.
I directly install all dependencies with NuGet. I also uninstalled and reinstalled everything.

the PdfDocument() references to "PdfSharp-gdi.dll"

I have references to the MigraDoc and PdfSharp dlls

@ThomasHoevel
Copy link
Member

You can start with our IssueSubmissionTemplate, compile it, run it.

If that works, then add other NuGet packages one by one along with code that uses the added NuGet package, compile it, test it.

If that fails, then you know which NuGet package causes the issue.
If you cannot resolve the issue yourself, submit the ZIP file so we can have a look.

Here's picture of my app folder:

Image

All our assemblies are from February 6, all Microsoft assemblies related to logging are from September 17.

@Marcus-Sie
Copy link
Author

I try to give more Information.
Also in the designer I get the errors.

Image

Also the date of the Dlls seems to be OK:

Image

@ThomasHoevel
Copy link
Member

Your folder screen shot shows some assemblies that we do not use in our application.

As I wrote before:
You can start with our IssueSubmissionTemplate, compile it, run it.
If that works, then add other NuGet packages one by one along with code that uses the added NuGet package, compile it, test it.
If that fails, then you know which NuGet package causes the issue.
If you cannot resolve the issue yourself, submit the ZIP file so we can have a look.

A different approach: Download the PDFsharp source code, set the logging reference to 8.0.0 and compile your own assemblies, maybe create your own local NuGet package.

@ThomasHoevel
Copy link
Member

As I wrote before: MigraDoc 6.2.0 Preview 3 depends on Logging >= 8.0.1 which in turn depends on Logging.Abstractions >= 8.0.2.

Image

So it must be an assembly outside MigraDoc/PDFsharp that references version 8.0.0 of Logging.Abstractions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Cannot Reproduce https://xkcd.com/583/ forum Please use Discussions or the Support forum to ask Support questions - https://forum.pdfsharp.net/ support
Projects
None yet
Development

No branches or pull requests

2 participants