Centos 部署 .net core The type initializer for 'System.DrawingCore.GDIPlus' threw an exception


.net core 2.2發布后支持System.Drawing.Common繪圖,可以做一些圖片驗證碼之類的功能,應用程序在Windows上運行功能正常,但是部署到centos上就會報錯:

System.TypeInitializationException: The type initializer for 'System.DrawingCore.GDIPlus' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'gdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdiplus: cannot open shared object file: No such file or directory

解決辦法:

centos上安裝libgdiplus-devel;

命令如下:yum install libgdiplus-devel 

安裝完成后重啟 .net core 服務  OK!


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM