I am attempting to run the Aspose.Total platform (v21.11.0) within a docker container on linux. I have references to the SkiaSharp.NativeAssets.Linux.NoDependencies (v2.80.3) library, as well as Microsoft.DotNet.PlatformAbstractions (v6.0.0) library.
My Dockerfile has the following:
RUN apt-get update && apt-get -f install && apt-get -y install libfontconfig1 libgdiplus
RUN cd /usr/lib && ln -s libgdiplus.so gdiplus.dll
RUN apt-get install -y --no-install-recommends libc6-dev
RUN export LD_LIBRARY_PATH=/usr/lib
as part of the deployment.
I am getting the following exception while running my code:
The type initializer for ‘Gdip’ threw an exception. System.TypeInitializationException: The type initializer for ‘Gdip’ threw an exception.
—> System.PlatformNotSupportedException: System.Drawing.Common is not supported on non-Windows platforms. See https://aka.ms/systemdrawingnonwindows for more information.
at System.Drawing.LibraryResolver.EnsureRegistered()
at System.Drawing.SafeNativeMethods.Gdip.PlatformInitialize()
at System.Drawing.SafeNativeMethods.Gdip…cctor()
— End of inner exception stack trace —
at System.Drawing.SafeNativeMethods.Gdip.GdipStringFormatGetGenericTypographic(IntPtr& format)
at System.Drawing.StringFormat.get_GenericTypographic()
at …ctor(Bitmap )
at …ctor(Int32 , Int32 , Single , Single , Boolean , Boolean , , SortedList2 ) at Aspose.Slides.Slide.(Boolean , , , SortedList
2 , InterruptionToken )
at .(Presentation , Stream , Int32[] , PdfOptions , InterruptionToken )
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format, ISaveOptions options)
at Aspose.Slides.Presentation.Save(Stream stream, SaveFormat format)
I am also getting the following exception I am unable to handle:
Unhandled exception. System.ArgumentNullException: Value cannot be null. (Parameter ‘buffer’)
at SkiaSharp.SKManagedStream.OnReadManagedStream(IntPtr buffer, IntPtr size)
at SkiaSharp.SKAbstractManagedStream.ReadInternal(IntPtr s, Void* context, Void* buffer, IntPtr size)