ASP.NET Core on Linux - Unable to load DLL libgdiplus - how to fix it How to fix the Unable to load DLL libgdiplus - gdiplus.dll not found in Linux error using ASP.NET Core and Linux

How to Deploy a ASP.NET Core 2 Web Application to Linux CentOS - Tutorial

Today I faced a minor issue while trying to publish my ASP.NET Core project on my Linux CentOS production machine. The error I got was the following:

Unable to load DLL libgdiplus - gdiplus.dll not found

As soon as I read it, I was immediately aware what the problem was: since my project is widely using the GDI Plus library, the .NET Core Framework tries to access the System.Drawing.GDIPlus namespace... which doesn't exist natively on Linux.

The Solution

Luckily enough, the fix was really simple: I just had to install the GDI+ package with the following command:

If you're not using CentOS, you might have to use apt-get instead of yum:

Once I did that, the ASP.NET Core web app started to work without other issues.

Conclusion

That's it! I hope that this post will help other developers to fix this GDI+ problem for good.

 

About Ryan

IT Project Manager, Web Interface Architect and Lead Developer for many high-traffic web sites & services hosted in Italy and Europe. Since 2010 it's also a lead designer for many App and games for Android, iOS and Windows Phone mobile devices for a number of italian companies. Microsoft MVP for Development Technologies since 2018.

View all posts by Ryan

Leave a Reply

Your email address will not be published. Required fields are marked *


The reCAPTCHA verification period has expired. Please reload the page.

This site uses Akismet to reduce spam. Learn how your comment data is processed.