Welcome Guest Search | Active Topics | Sign In | Register

Using System.Drawing.Common on .net 8 azure function Options
Kunal Choudhary
Posted: Monday, November 18, 2024 2:35:24 AM
Rank: Member
Groups: Member

Joined: 6/14/2013
Posts: 11
Hello Team,

I have a EOPDF implementation that is on azure function, currently we are using the 2022 version of EOPDF on .Net 6 Azure function. We are in the process of upgrading the Azure function to .Net 8 and also upgrading to 2024 version of EOPDF. While testing locally the changes in the dll works without need to change anything, however once deployed it gives error "Could not load file or assembly 'System.Drawing.Primitives, Version=8.0.0.0, Culture=neutral, PublicKeyToken=XXXXX. The system cannot find the file specified."

Can you help me with this issue fix?
eo_support
Posted: Monday, November 18, 2024 1:46:25 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,200
Hi,

We do not reference this assembly directly and I do not believe this assembly exists on .NET 8. Do you have the full call stack of this problem? Do you have any explicit assembly redirection in your config file?

Thanks!
Kunal Choudhary
Posted: Tuesday, November 19, 2024 7:29:47 AM
Rank: Member
Groups: Member

Joined: 6/14/2013
Posts: 11
We are using it to set OutputArea and PageSize to pass the parameter - htmltopdfOptions for `ConvertUrl()`

I was able to set PageSize = PdfPageSizes.A4; but how to customize if or set OutputArea
eo_support
Posted: Wednesday, November 20, 2024 1:20:43 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,200
Hi,

We looked into this further and in fact System.Drawing.Primitives is part of .NET 8. You can verify this by checking Dependencies -> Frameworks -> Microsoft.NETCore.App and you should see System.Drawing.Primitives there.

You can try to set your publish mode as "Self-Contained" and then rebuild your function app. You should see System.Drawing.Primitives.dll in your output directory. You can then make sure this file is deployed to your server.

Thanks!


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.