0

I'm getting this exception "Unhandled exception. System.TypeLoadException: Cannot load type 'System.Void, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'." While using Aspose PDF in our QA env, which is dockerized from the base images "dotnet/sdk:6.0-alpine" and "dotnet/runtime-deps:6.0-alpine" .

Is there any compatibility issue between these images and Aspose?

Aspose Library version: 22.12.0 (Even tried with 23.1.0)

NOTE: This is only occurring in QA environment where we have dockerized the application, but working fine in Dev environment where no Dockerization happening?

Sreeraj TR
  • 99
  • 1
  • 12
  • 1
    Please try using Aspose.PDF.Drawing package instead of Aspose.PDF. Also, make sure that Windows Fonts and libgdiplus packages are properly installed. In case you still face any issues, please create a topic in official Aspose.PDF support forum (https://forum.aspose.com/c/pdf) which is right place for such discussions. This is Asad Ali and I work as Developer Evangelist at Aspose. – Asad Ali Feb 24 '23 at 18:39
  • Thanks @AsadAli . I verified with Aspose.PDF.Drawing. I tried to install some ms fonts. But didn't work. Anyway, created a new support ticket in Aspose PDF forum. https://forum.aspose.com/t/aspose-pdf-library-throwing-unhandled-exception-system-typeloadexception-cannot-load-type-system-void-mscorlib-while-running-in-docker-container/260545 – Sreeraj TR Feb 26 '23 at 15:17

1 Answers1

0

This issue is fixed in our environment. The rootcause was the dotnet publish options present in the Dockerfile. PublishTrimmer=true, which trimmed some required classes which required for Aspose to run it seems. Started working once we removed this parameter.

Sreeraj TR
  • 99
  • 1
  • 12