I have a .NET 9 ASP.NET Web API application running in a Linux container in Azure Kubernetes Services. It uses Aspose.Drawing, Aspose.Imaging, Aspose.Slides.NET all version 25.4.0. It also uses Apose.Pdf.Drawing version 25.3.0.
It is throwing this exception:-
PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.
The exception happens on this line:-
IImage image = slide.GetImage(2.0f, 2.0f);
The 3 lines of relevant code are:-
using var presentation = new Presentation(pptStream);
ISlide slide = presentation.Slides[pageIndex];
IImage image = slide.GetImage(2.0f, 2.0f);
My Dockerfile includes these lines:-
RUN apt-get update && \
apt-get install -y libgdiplus && \
cd /usr/lib && ln -s libgdiplus.so gdiplus.dll
RUN apt-get install -y --no-install-recommends libc6-dev
I expected this to work on Linux because I am including the Aspose.Drawing NuGet package and including libgdiplus in the deployment but clearly it is failing because it is trying to use the Windows-only System.Drawing.Common.
Any ideas why?