.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 ...
随机推荐
- centos清理缓存
释放网页缓存(To free pagecache): echo 1 > /proc/sys/vm/drop_caches 释放目录项和索引(To free dentries and inodes ...
- hive中not in优化
比如:A,B两表,找到ID字段中,存在A表,但不存在B表的数据. A表共13w,去重后3w,B表共2W,且有索引 方法一 not in,易理解,效率低,时间:1.395s )
- 用webdriver模仿浏览器 爬取豆瓣python书单
用webdriver模仿浏览器 爬取豆瓣python书单 其中运用到os 模块 作用是生成文件夹 存储爬取的信息 etree 用于xpath解析内容 详细代码如下 可用我的上一篇博客存取到excel当 ...
- Linux vsftpd服务配置以及三种验证方式以及常见错误解决办法
文件传输协议(FTP): 文件传输协议(FTP,File Transfer Protocol),即能够让用户在互联网中上传.下载文件的文件协议,而FTP服务器就是支持FTP传输协议的主机,要想完成文件 ...
- SAP内表查询速度优化实例-OPEN SQL
一.FOR ALL ENTRIES IN 案例 今天碰到工单报工统计分析表查询速度特别慢 经查看源代码: SELECT afpo~dwerk afko~aufnr afpo~matnr AS plnb ...
- 隐藏父类方法的new和重写父类虚方法virtual的区别
一.代码 public class Parent { public void Method_A() { Console.WriteLine("Parent Method_A"); ...
- 分布式服务防雪崩熔断器,Hystrix理论+实战。
Hystrix是什么? hystrix对应的中文名字是"豪猪",豪猪周身长满了刺,能保护自己不受天敌的伤害,代表了一种防御机制,这与hystrix本身的功能不谋而合,因此Netfl ...
- 日志=>flume=>kafka=>spark streaming=>hbase
日志=>flume=>kafka=>spark streaming=>hbase 日志部分 #coding=UTF-8 import random import time ur ...
- luoguP1313 计算系数 题解(NOIP2011)
P1313 计算系数 题目 #include<iostream> #include<cstdlib> #include<cstdio> #include<cm ...
- hdu1158 Employment Planning(dp)
题目传送门 Employment Planning Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Jav ...