[NET Core]Epplus于linux环境下无预设lib的报错与解决

Epplus于linux环境下无预设lib的报错与解决

Epplus为.NET众所皆知的Excel读取与写入函式库

在利用此函式库撰写相关功能报表并于Windows环境下测试与呈现结果皆是正常的.

然而把sevice app于linux docker的容器环境下run在此功能会丢出:

the type initializer for 'gdip' threw an exception.

原因:

经查询的错误原因为.NET的System.Drawing.dll内部依赖了 gdiplus.dll ,
而gdiplus.dll在Windows的环境上操作系统会自带此dll,而在Mac和linux系统是没有相关预设只能自己去添加

解决:

于app所在的docker内更新并安装此lib再重启该功能的app便可以正常运作

1.进入到docker
2.RUN apt-get update && apt-get install -y libgdiplus
3.重启app

source:

Unable to load shared library “libgdiplus” - Docker [ .NET application with Aspose API]

【asp.net core】macOS Gdip 报错

tags: netcore linux docker epplus

关于作者: 网站小编

码农网专注IT技术教程资源分享平台,学习资源下载网站,58码农网包含计算机技术、网站程序源码下载、编程技术论坛、互联网资源下载等产品服务,提供原创、优质、完整内容的专业码农交流分享平台。

热门文章