数据库
MySQL
ORACLE
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
Linux运维
中间件
shell脚本
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
占位哈哈
首页 动态 发帖 版块 我的
 退出
游客  
等级:
金豆:
经验:
首页  /  linux运维  /  linux服务  /  正文

.net Core 在 CentOS7下,报The type initializer for 'Gdip' threw an exception.错误的解决办法

  1674 
 0
 0
.net Core允许在 Centos7 上,使用 System.Draw.Common类库时,报以下错误:

"Class":"System.TypeInitializationException",
        "Message":"Unable to load DLL 'libgdiplus': The specified module could not be found.",
        "StackTrace":" at System.Drawing.SafeNativeMethods.Gdip.GdipCreateBitmapFromFile(String filename, IntPtr& bitmap)
at System.Drawing.Bitmap..ctor(String filename, Boolean useIcm)
at Ims.Dsl.Utility.ImageUtils.GetResolution(String filePath)
at Ims.Dsl.Persistence.Service.Impl.TemplateService.CreateUploadImage(IList`1 files, String createIp)
at Ims.Dsl.RestApi.Controllers.v1.TemplateController.UploadImage()
解决方案如下:

yum install autoconf automake libtool
yum install freetype-devel fontconfig libXft-devel
yum install libjpeg-turbo-devel libpng-devel giflib-devel libtiff-devel libexif-devel
yum install glib2-devel cairo-devel
git clone https://github.com/mono/libgdiplus
cd libgdiplus
./autogen.sh
make
make install
创建符号链接:

ln -s /usr/local/lib/libgdiplus.so /usr/lib64/libgdiplus.so
ln -s /usr/local/lib/libgdiplus.so /usr/libgdiplus.so

标签:
作者签名: 只有努力,才会有收获   楼主  2020-10-21 17:07:29

点赞推荐

回复列表
合作伙伴:
Powered by 运维术 8.3.2
© 2017-2024 模板 by 黑衣人
您的IP: 3.144.232.46 , 2024-09-19 09:18:23
Powered by 运维术 8.3.2
© 2017-2024 模板 by 黑衣人
(0) 分享
分享
取消
我的客服