Hi, I’m getting the following error when running an application using Aspose.Slides in a Alpine linux container. I’ve tried upgrading to 25.10, but the issue still persists. It occurs when the code attempts to clone a slide and we receive the following error:
System.TypeInitializationException: The type initializer for 'Windows.Win32.PInvoke' threw an exception.
2025-11-04 16:40:23.124 | ---> System.TypeInitializationException: The type initializer for 'System.Drawing.Gdip' threw an exception.
2025-11-04 16:40:23.124 | ---> System.TypeInitializationException: The type initializer for 'Windows.Win32.Graphics.GdiPlus.GdiPlusInitialization' threw an exception.
2025-11-04 16:40:23.124 | ---> System.DllNotFoundException: Unable to load shared library 'gdiplus.dll' or one of its dependencies. In order to help diagnose loading problems, consider using a tool like strace. If you're using glibc, consider setting the LD_DEBUG environment variable:
2025-11-04 16:40:23.124 | Error loading shared library /app/gdiplus.dll.so: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.10/gdiplus.dll.so: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library gdiplus.dll.so: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library /app/libgdiplus.dll.so: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.10/libgdiplus.dll.so: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library libgdiplus.dll.so: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library /app/gdiplus.dll: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.10/gdiplus.dll: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library gdiplus.dll: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library /app/libgdiplus.dll: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library /usr/share/dotnet/shared/Microsoft.NETCore.App/9.0.10/libgdiplus.dll: No such file or directory
2025-11-04 16:40:23.124 | Error loading shared library libgdiplus.dll: No such file or directory
2025-11-04 16:40:23.124 |
2025-11-04 16:40:23.124 | at Windows.Win32.PInvokeCore.GdiplusStartup(UIntPtr* token, GdiplusStartupInput* input, GdiplusStartupOutput* output)
2025-11-04 16:40:23.124 | at Windows.Win32.PInvokeCore.GdiplusStartup(UIntPtr* token, GdiplusStartupInput* input, GdiplusStartupOutput* output)
2025-11-04 16:40:23.124 | at Windows.Win32.Graphics.GdiPlus.GdiPlusInitialization.Init()
2025-11-04 16:40:23.124 | at Windows.Win32.Graphics.GdiPlus.GdiPlusInitialization..cctor()
2025-11-04 16:40:23.124 | --- End of inner exception stack trace ---
2025-11-04 16:40:23.124 | at Windows.Win32.Graphics.GdiPlus.GdiPlusInitialization.EnsureInitialized()
2025-11-04 16:40:23.124 | at System.Drawing.Gdip.Init()
2025-11-04 16:40:23.124 | at System.Drawing.Gdip..cctor()
2025-11-04 16:40:23.124 | --- End of inner exception stack trace ---
2025-11-04 16:40:23.124 | at System.Drawing.Gdip.get_Initialized()
2025-11-04 16:40:23.124 | at Windows.Win32.PInvoke..cctor()
2025-11-04 16:40:23.124 | --- End of inner exception stack trace ---
2025-11-04 16:40:23.124 | at Windows.Win32.PInvoke.GdipCreateFontFamilyFromName(PCWSTR name, GpFontCollection* fontCollection, GpFontFamily** fontFamily)
2025-11-04 16:40:23.124 | at Windows.Win32.PInvoke.GdipCreateFontFamilyFromName(PCWSTR name, GpFontCollection* fontCollection, GpFontFamily** fontFamily)
2025-11-04 16:40:23.124 | at System.Drawing.FontFamily.CreateFontFamily(String name, FontCollection fontCollection)
2025-11-04 16:40:23.124 | at .(String , String&)
2025-11-04 16:40:23.124 | at .(String , FontStyle, Boolean )
2025-11-04 16:40:23.124 | at .(String , FontStyle)
2025-11-04 16:40:23.124 | at.( , Boolean)
2025-11-04 16:40:23.124 | at.( , Boolean, Single , ␛ , Int32 , Boolean )
2025-11-04 16:40:23.124 | at .( , String, ␛ , Int32 , Single , FontStyle , Boolean )
2025-11-04 16:40:23.124 | at .(String , ␛, Int32 , Single , FontStyle , Boolean )
2025-11-04 16:40:23.124 | at .(String , ␛, Int32 , Single , FontStyle , Boolean )
2025-11-04 16:40:23.124 | at ␛.(String , ␛, Int32 , Single , FontStyle , Boolean )
2025-11-04 16:40:23.124 | at .()
2025-11-04 16:40:23.124 | at .(& , Boolean&)
2025-11-04 16:40:23.124 | at ␛.()
2025-11-04 16:40:23.124 | at ␛..ctor(TextFrame , , IBaseSlide , , [] )
2025-11-04 16:40:23.124 | at .( , )
2025-11-04 16:40:23.124 | at.( , Single, Single , )
2025-11-04 16:40:23.124 | at.( , &, RectangleF& , )
2025-11-04 16:40:23.124 | at.( , ShapeFrame&, RectangleF& , )
2025-11-04 16:40:23.124 | at .(IAutoShape , , , ␛ )
2025-11-04 16:40:23.124 | at .(IGroupShape , , , ␛ )
2025-11-04 16:40:23.124 | at.(IBaseSlide , , )
2025-11-04 16:40:23.124 | at ␛.(IMasterSlide , Boolean)
2025-11-04 16:40:23.124 | at .(␛ , IMasterSlide, Boolean , )
2025-11-04 16:40:23.124 | at.(IPresentation , IMasterSlide, Boolean )
2025-11-04 16:40:23.124 | at Aspose.Slides.MasterSlideCollection.(MasterSlide , Boolean)
2025-11-04 16:40:23.124 | at Aspose.Slides.MasterSlideCollection.(IMasterSlide , Boolean)
2025-11-04 16:40:23.124 | at Aspose.Slides.SlideCollection.AddClone(ISlide sourceSlide)
I’ve already tried installing libgdiplus using ’ apk add’, but it’s possible that the project or container are missing something.