PDFsharp & MigraDoc Foundation

PDFsharp - A .NET library for processing PDF & MigraDoc Foundation - Creating documents on the fly
It is currently Sun Dec 08, 2024 4:03 pm

All times are UTC


Forum rules


Please read this before posting on this forum: Forum Rules



Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Could not load file...
PostPosted: Tue Oct 08, 2024 7:57 am 
Offline

Joined: Sat Nov 20, 2021 4:34 am
Posts: 8
Hello,

I have upgraded to PDFsharp 6.1.1 by adding it to my project using NuGet. I am running Visual Studio 2022 Community and have also upgraded to dotnet 8.0.402.
Since doing this my project can no longer create a pdf. I have modified my code to correct the older xFontStyle to xFontStyleEx etc., but now I get an error when I try:
Code:
Dim page As PdfPage = document.AddPage

I get error:
System .IO.File Load Exception. It says "Could not load file or assembly:"
"Microsoft.Logging.Abstactions, Version 8.0.0.1, Culture = neutral, PublicTokenKey = .......

Searching for this has led me to a concern that I should have have downloaded assets as per the "Prerequisites page:" https://docs.pdfsharp.net/General/Overview/Download-Assets.html.
Does adding from NuGet still require this Prerequisite download of the assets? Or is this a separate issue altogether?

Thank you for you assistance.
Brad


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 08, 2024 11:28 am 
Offline
PDFsharp Guru
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 1019
Location: CCAA
bhendo54@gmail.com wrote:
I get error:
System .IO.File Load Exception. It says "Could not load file or assembly:"
"Microsoft.Logging.Abstactions, Version 8.0.0.1, Culture = neutral, PublicTokenKey = .......
The NuGet package has a dependency on Microsoft.Extensions.Logging.

Please add https://www.nuget.org/packages/Microsof ... ions/8.0.1 to your project and let us know if that resolves the issue.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Tue Oct 08, 2024 11:21 pm 
Offline

Joined: Sat Nov 20, 2021 4:34 am
Posts: 8
Thanks Thomas
That did the trick.
With the upgrade to 6.1.1 I am also receiving many warning about conflicts:
"System Memory"
"Microsoft.Bcl.AsyncInterfaces"
"Microsoft.Extensions.Options"
"Microsoft.Extensions.DependencyInjection"
"System.Diagnostics.DiagnosticSource"

Is this related to the upgrade and is it possible to remove these warnings?

Thanks again
Brad


Top
 Profile  
Reply with quote  
PostPosted: Wed Oct 09, 2024 8:10 am 
Offline
PDFsharp Guru
User avatar

Joined: Sat Mar 14, 2015 10:15 am
Posts: 1019
Location: CCAA
bhendo54@gmail.com wrote:
Is this related to the upgrade and is it possible to remove these warnings?
Find out which NuGet packages use older versions of these packages and try to upgrade those.
Can be difficult to find which packages bring references to old packages with them, but can be done.
We switched from the 6.0 logging version to the 8.0 logging version to remove warnings about the System.Memory module.

_________________
Best regards
Thomas
(Freelance Software Developer with several years of MigraDoc/PDFsharp experience)


Top
 Profile  
Reply with quote  
PostPosted: Mon Oct 14, 2024 12:28 am 
Offline

Joined: Sat Nov 20, 2021 4:34 am
Posts: 8
Thanks Thomas
I did find upgrades available for Logging to 8.0 and processed those, however the warning still persist. Will keep looking.

Thanks again
Brad


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 28 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Privacy Policy, Data Protection Declaration, Impressum
Powered by phpBB® Forum Software © phpBB Group