We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

AsposeSvg:TypeInitializationException:The type initializer for 'Gdip' threw an exception

I’m building an application that runs on both windows and macos.

This application converts svg to bmp.

On Windows (10) it works but on MacOs I get:

TypeInitializationException:The type initializer for ‘Gdip’ threw an exception.

We’re using the latest AsposeSvg and the app is built in .net 6.

See code example:

AsposeSvg.zip (106.3 KB)

@nielsbosma

Would you kindly make sure that libgdiplus package is installed and up-to-date in the system running macOS at your side? In case issue still occurs, please let us know.

Yes it’s installed:

image.png (6.4 KB)

Unhandled exception. System.TypeInitializationException: The type initializer for ‘Gdip’ threw an exception.
—> System.DllNotFoundException: Unable to load DLL ‘libgdiplus’: The specified module could not be found.
at System.Runtime.InteropServices.FunctionWrapper`1.get_Delegate()
at System.Drawing.SafeNativeMethods.Gdip.GdiplusStartup(IntPtr& token, StartupInput& input, StartupOutput& output)
at System.Drawing.SafeNativeMethods.Gdip…cctor()
— End of inner exception stack trace —
at System.Drawing.SafeNativeMethods.Gdip.GdipCreatePath(FillMode brushMode, IntPtr& path)
at System.Drawing.Drawing2D.GraphicsPath…ctor()
at …ctor()
at Aspose.Svg.Rendering.Image.ImageDevice…ctor(ImageRenderingOptions options, String file)
at Program.$(String[] args) in /Users/filestar/repos/Filestar/experimental/AsposeSvg/Program.cs:line 8

@nielsbosma

We have logged an investigation ticket as SVGNET-78 in our issue tracking system for further analysis on this case. We will look into its detail and let you know as soon as it is resolved. Please be patient and spare us some time.

We are sorry for the inconvenience.