#ASP.NETCore2
Explore tagged Tumblr posts
ryadel · 6 years ago
Text
ASP.NET Core e Linux - Unable to load DLL libgdiplus - come risolvere
Tumblr media
Oggi, durante la pubblicazione di un progetto ASP.NET Core sul mio server di produzione Linux CentOS, mi sono imbattuto in un problema che non mi era mai capitato prima. Al momento di lanciare la pagina principale, la web app restituiva il seguente errore: Unable to load DLL libgdiplus - gdiplus.dll not found Nel leggerlo, ho capito subito che il problema era quasi certamente legato all'impossibilità, da parte di ASP.NET Core, di recuperare la libreria GDI Plus, che nel mio progetto era ampiamente utilizzata. A quanto pare il .NET Core Framework non riusciva a recuperare i metodi presenti nel namespace System.Drawing.GDIPlus. Il motivo, come ho avuto modo di scoprire molto presto, è molto semplice: si tratta di una libreria che non fa parte del .NET Core runtime su Linux.
La soluzione
Fortunatamente, la soluzione del problema è molto semplice: è sufficiente installare il pacchetto lbgdiplus, disponibile per tutte le principali distribuzioni Linux, che fornisce il supporto del namespace System.Drawing.GDIPlus. Per installarlo, è sufficiente digitare il seguente comando: > sudo yum install libgdiplus Se la vostra distribuzione Linux non utilizza yum, è probabile che dobbiate utilizzare apt-get al suo posto: > sudo apt-get install libgdiplus Una volta fatto questo, l'applicazione ASP.NET Core dovrebbe funzionare senza problemi, con tutte le funzionalità GDI+ previste.
Conclusione
Per il momento è tutto: mi auguro che questo articolo possa aiutare altri sviluppatori .NET Core a risolvere rapidamente questo problema.   Read the full article
0 notes
ryadel · 6 years ago
Text
ASP.NET Core on Linux - Unable to load DLL libgdiplus - how to fix it
Tumblr media
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: > sudo yum install libgdiplus If you're not using CentOS, you might have to use apt-get instead of yum: > sudo apt-get install libgdiplus 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.   Read the full article
0 notes