PCF + libgdiplus on .Net Core

Hi Team,

I’m getting runtime error “System.DllNotFoundException: Unable to load DLL ‘libgdiplus’” while generating barcode using aspose.barcode in PCF hosting dev environment but works locally fine in my windows machine.
Solutions i tried so far :

  1. Added “System.Drawing.Common” package to host and tested.
  2. Update Fax service with “CoreCompact.libgdiplus Nuget package and tested.
  3. Update Fax service with “System.Text.Encoding.CodePages” Nuget package and tested.
  4. Add PCF environment variables to point to these dlls and tested.

Host server details :

  1. PCF ( Cloud Foundry stack: cflinuxfs3)
  2. .Net Core

Note: I created this in a separate thread as suggested from my other discussion

Thank you for creating a separate thread for this issue. We got a similar issue in another Aspose product and tried the following steps. Could you please try the following steps and share the feedback.

Here are my steps:

  1. The docker I used is: microsoft/dotnet, install it first (In your case you may choose your required environment)

    sudo docker pull microsoft/dotnet
  2. Then I install libgdiplus:

     apt-get update
     apt-get install -y libgdiplus
     cd /usr/lib && ln -s libgdiplus.so gdiplus.dll
  3. And install libc6-dev:

    apt-get install -y --no-install-recommends libc6-dev

Thank you for your reply.
We couldn’t try steps mentioned by you as we are not using docker and don’t have root access to the container.
We are using PCF containers. Please click on below link to get details about it.

We have understood the issue but we need to look into it more. We have logged the issue in our database for investigation and for a fix. Once, we will have some news for you, we will update you in this topic.

This issue has been logged as

BARCODENET-37490 – Unable to load DLL 'libgdiplus' exception in PCF hosting development environment

Hello, @mani.g ! As far as I understood, you’re using CloudFoundry stack with Ubuntu host.
According to dotnet-core-buildpack release notes libgdiplus has already shipped with buildpack. Have you tried to deploy your application with newer buildpack? Also there is ability to use external libraries with your application https://docs.cloudfoundry.org/buildpacks/dotnet-core/index.html#custom-libraries.

Hi denex,
thank you for the reply.
what is the minimum version of the dotnetcore build pack we’d need to have so that the library automatically included?

We are gathering information in this regard and will share our feedback soon.

I found the first mention of libgdiplus in v2.2.5 Jan 23, 2019 in their changelog file. I’ll check this information lately in details.

Thank you for the reply.
After updating the with dotnet buildpack which has libgdiplus version, barcode got generated but we have two issues now which works as expected in local windows machine but not in PCF:

  1. Barcode is not getting replaced with the text in the word document.using Aspose.Words.Replacing interface implementation.
  2. The Font size of the word document changed in PCF, Do we know the supported MS word format when using ubuntu+aspose or PCF+aspose to understand the limitation of font and to get consistent look and feel of document templates.

I’m glad you solved issue with libgdiplus.
Unfortunately I can not help you with Aspose.Words issues. It will be better to start (or find relevant) topic in Aspose.Words branch. Feel free to ask me about Barcode issues.