libgdiplus

.NET Core requires libgdiplus to use the Microsoft System.Drawing.Common nuget package.   If it is not found on MacOS on Linux you may experience this exception:

  • Unhandled exception. System.DllNotFoundException: Could not find or load the native library from any name: [ libgdiplus, libgdiplus.so ]
  • If you see System.TypeInitializationException : The type initializer for 'Gdip' threw an exception then please read our System.Drawing.Common in NET6 guide instead.

Linux

Ubuntu, Debian:

apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev

More information:
https://packages.ubuntu.com/search?keywords=libgdiplus&searchon=names&suite=all§ion=all


Docker

Add this line to Docker File it should work 

RUN apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev

 
MacOS

Unhandled exception. System.DllNotFoundException: Could not find or load the native library from any name: [ libgdiplus, libgdiplus.dylib ]