首页 > Web开发 > 详细

.net core 部署在centos7,验证码不显示

时间:2021-03-31 13:59:37      阅读:21      评论:0      收藏:0      [点我收藏+]

.net core 部署在centos7,验证码不显示,报如下错误:

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

参照:https://github.com/dotnet/core/issues/2746

sudo yum install libc6-dev 
sudo yum install libgdiplus

 继续解决下一个问题

正常验证码如下

技术分享图片

 

 部署到centos 7,变形了,字体的位置好像不对路啊,什么鸟问题??

字体用的是资源包里的,

pfc.AddMemoryFont(ResourcesHelper.GetResFontPtr(Properties.Resources.elephant), Properties.Resources.elephant.Length);
pfc.AddMemoryFont(ResourcesHelper.GetResFontPtr(Properties.Resources.georgia), Properties.Resources.georgia.Length);
pfc.AddMemoryFont(ResourcesHelper.GetResFontPtr(Properties.Resources.Vineta), Properties.Resources.Vineta.Length);

 

技术分享图片

 

 

待解决...........

 

.net core 部署在centos7,验证码不显示

原文:https://www.cnblogs.com/icejd/p/14600938.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!