We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Aspose library throwing error on Linux server for PDF file generation

We are using Apose.Cells licensed library 21.2.0 in .Net Core project.
Code is deployed on Linux server and working file for types xls. csv. When we are trying to generate PDF file it is throwing error - The type initializer for ' ’ threw an exception.
It is working fine on local(windows) code for same data with same Aspose library.


This may be an environment issue on your end. Please make sure that libgdiplus (in particular) which is required by the library for graphics rendering, is installed on linux machine. Could you please try the following steps and share your feedback as in many cases these steps has resolved the issue.

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

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

Hope, this helps a bit.

Hi @Amjad_Sahi ,
I checked libgdiplus is already installed on server.
Also libc6-dev is development library and It shouldn’t be added to prod env.
Any other options which we can try?


It seems configuration issue on your end. Anyways, could you please try using our latest version/fix: Aspose.Cells for .NET v22.3 (Download | NuGet) if it makes any difference. If you still find the issue with latest version/fix, kindly do share complete environment details and other resource files, e.g., OS with version details, .NET framework version, sample project, template files, etc. We will check it further.