Aspose.Slides for .NET 24.10 - PptxReadException when Loading a PPTX File

I’m encountering an issue with Aspose.Slides.Net, Version 21.10.0 when trying to load a PPTX file. The application throws the following exception:

Exception Type: PptxReadException
Message: The type initializer for ‘Gdip’ threw an exception.

The funny part is; after upgrading to the latest version, this exception changed its position from Read to Save.

Exception Type: PlatformNotSupportedException
Message: System.Drawing.Common is not supported on this platform.
Stack Trace: at System.Drawing.Image…ctor()
at System.Drawing.Bitmap…ctor(Int32 width, Int32 height, PixelFormat format)
at .(Size ,  )
at .(Size )
at Aspose.Slides.Slide.GetThumbnail(Size imageSize)
at .(e , IPresentation )
at .(Presentation ,  , IPptxOptions , InterruptionToken )
at .(Presentation , Stream ,  , IPptxOptions , InterruptionToken )
at Aspose.Slides.Presentation.(Stream ,  , IPptxOptions )
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)
at Aspose.Slides.Presentation.Save(String fname, SaveFormat format)

It seems to be related to the GDI+ library, which Aspose.Slides uses for rendering images and shapes in PowerPoint files.

I’ve already tried reinstalling the library and ensuring that all system dependencies (like GDI+) are present, I also tried changing the dependency library to SkiaSharp, but the issue persists.

Any help would be much appreciated!

@tanmaysheoranEAI,
Thank you for contacting free support.

We are sorry that you have to encounter this problem. Please share the following additional information so that we can investigate the case and assist you:

  • OS version on which the error occurred
  • .NET target platform in your application project

The application is running in a Docker container with Debian, and I also tried it with Ubuntu, but it didn’t work.
The project is built on .NET 8.0.

@tanmaysheoranEAI,
Thank you for the additional information. Please note the following:

More details:
System Requirements|Aspose.Slides Documentation
Aspose.Slides for .NET 6 Cross Platform|Aspose.Slides Documentation

Worked like a charm !

Thank you so much for your help

@tanmaysheoranEAI,
We are glad that the issue has been resolved on your end. Thank you for your feedback.