.net Core 在 CentOS7下,报The type initializer for 'Gdip' threw an exception.异常
.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` 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
.net Core 在 CentOS7下,报The type initializer for 'Gdip' threw an exception.异常的更多相关文章
- ASP.Net Core "The type initializer for 'Gdip' threw an exception"
ASP.NET Core项目部署在Linux下可能会出现GDI错误 The type initializer for 'Gdip' threw an exception 解决方案:创建 libdl 的 ...
- System.Drawing Linux Centos7 The type initializer for 'Gdip' threw an exception
System.Drawing 在linux使用时提示异常 The type initializer for 'Gdip' threw an exception 解决方案: yum install au ...
- 使用Spire组件抛出异常The type initializer for 'spr857' threw an exception
使用Spire组件抛出异常The type initializer for 'spr857' threw an exception 我使用免费的Spire.Xls组件尝试去转换Excel文档到PDF文 ...
- centos7下报错: import requests ImportError: No module named requests
在网上扒了一个python脚本,在centos7上执行的时候报错: import requestsImportError: No module named requests 原因是:requests是 ...
- Linux、CentOS7下报错-bash: TMOUT: readonly variable怎么办?
一.Linux操作系统版本 二.背景:在项目中当我们配置好JDK环境变量.Tomcat环境变量,通过source /etc/profile使环境变量生效时,发现会报错,如图 三.解决 个人尚不知出现原 ...
- 【CentOS&Core】CentOS7下安装.NET Core SDK 2.1
1.导入rpm源 sudo rpm -Uvh https://packages.microsoft.com/config/rhel/7/packages-microsoft-prod.rpm 2.更 ...
- .net core获取数据库连接 抛出The type initializer to throw an exception
原文:https://www.cnblogs.com/pudefu/p/7580722.html 在.NET Framework框架时代我们的应用配置内容一般都是写在Web.config或者App.c ...
- netcore在CentOS7 下使用处理图片的问题
请看代码,当你在centos下要把图片转为Base64的时候 MemoryStream ms = new MemoryStream(); try { Bitmap bmp = new Bitmap(f ...
- 在Centos7下安装与部署.net core
在Centos7下安装与部署.net core 2018年02月28日 19:36:16 阅读数:388 个人安装流程,参照文档 https://www.cnblogs.com/Burt/p/6566 ...
随机推荐
- 《JavaScript DOM 编程艺术》学习成果
(在线演示地址)[http://thqy39.github.io/works/03.Js%20DOM%20website/index.html]
- SimpleDateFormat 格式化时间少了12个小时
SimpleDateFormat 格式化时间少了12个小时 标签(空格分隔): java SimpleDateFormat H:一天中的小时数:0-23 h: am/pm 小时数: 1-12 publ ...
- 希尔排序(shell)理论---不含源码
| 版权声明:本文为博主原创文章,未经博主允许不得转载. 希尔排序,是一个缩小增量排序.它根据步长来进行排序,步长不同可能会产生不同的序列,但是他们的最终结果是相同的,希尔排序的官方理论难以理解, ...
- Oracle基础数据类型与运算符
Oracle基础数据类型: 1. 字符型:字符串 char(最大2000), nchar(最大1000, 支持 Unicode)--->固定长 ...
- 【Python—字典的用法】找到多个字典的公共键
有 a,b,c,d,e,f 6名球员,他们在三轮比赛中的进球数用 s1,s2,s3 3个字典表示,找到每轮都有进球的球员? 创建 s1,s2,s3 3个字典素材 from random import ...
- LINUX查看服务器硬件配置(转)
LINUX查看硬件配置 1. 查看所有硬件的型号 dmidecode | more # dmidecode 2.2 SMBIOS 2.5 present. 170 structures oc ...
- Python的基本数据类型,用户交互
整数: int 常见的数字都是int类型. 用于计算或者大小的比较 在32位机器上int的范围是: -2**31-2**31-1,即-2147483648-2147483647 在64位机器上int的 ...
- DOM查询的其他方法
document.body 保存的是body的引用 documen.documentElement 保存的是html根标签 document.all 代表页面中所有的元素 getElementsByC ...
- 循环结构select 语法
- 如何理解CPU上下文切换(二)
如何理解CPU上下文切换(二) 1.引 你们好,可爱的小伙伴们.^_^ 多个进程竞争CPU就是一个经常被我们忽视的问题. 你们一定很好奇,进程在竞争CPU的时候并没有真正运行,为什么还会导致系统的负载 ...