asp.net core项目在centos7.x下GUI 绘图组件System.Drawing.Common异常问题

         最近做了个asp.netcore 3.1SDK 的测试项目在CentOS环境下部署 发现绘制的验证码没法正常显示(windows下是正常的),查看日志发现

1 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

由此应该是少一些GUI图形绘制组件 参考了一些文章后

得出解决办法:

1.在centos下安装libgdiplus-devel;

 命令: 

yum install libgdiplus-devel 

2.重启 .netcore 服务(systemctl restart xxxxxx.service) 我是直接安装的centos下SDK 没用docker 

我相信用docker容器部署的也会出现这个问题  如果docker容器中遇到上述问题 可以试试进入容器 安装上面组件 重启容器 

 

参考了文章链接如下:

https://www.cnblogs.com/aynstan/articles/10823954.html

 

posted @ 2020-02-04 15:51  万年锋刀志  阅读(677)  评论(0编辑  收藏  举报