首页 新闻 赞助 找找看

asp.net core 使用ZKWeb.System.Drawing 生成验证码 linux 报错

0
悬赏园豆:15 [已解决问题] 解决于 2019-07-09 11:50

我用的是 ZKWeb.System.Drawing去画验证码 在windows 上 没有问题 。 但是 在linux 上报错 。
fail: Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware[0]
An unhandled exception has occurred: The type initializer for 'System.DrawingCore.GDIPlus' threw an exception.
System.TypeInitializationException: The type initializer for 'System.DrawingCore.GDIPlus' threw an exception. ---> System.DllNotFoundException: Unable to load shared library 'gdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdiplus: cannot open shared object file: No such file or directory

我Linux 上已经安装了 gdiplus.dll 请问 是什么原因

马玉溁的主页 马玉溁 | 初学一级 | 园豆:27
提问于:2018-09-11 11:22
< >
分享
最佳答案
0
收获园豆:15
dudu | 高人七级 |园豆:31075 | 2018-09-11 12:58

我src 指向我的 验证码地址的时候
出现了这个问题 请问 是什么原因啊? 在windows 上没有 在linux 上 有

马玉溁 | 园豆:27 (初学一级) | 2018-09-11 16:11

@马玉溁: 看日志

dudu | 园豆:31075 (高人七级) | 2018-09-11 16:44
其他回答(2)
0

.NET 不能跨平台吧

筱浬 | 园豆:601 (小虾三级) | 2018-09-11 11:44

我使用的是asp.net core

支持(0) 反对(0) 马玉溁 | 园豆:27 (初学一级) | 2018-09-11 11:46
0

1、 引入包后,把原来的using system.drawing 改为ussing system.DrawingCore 等这是常规的引用
2、linux服务器要安装 run apt-get update -y && apt-get install -y libgdiplus && apt-get clean && ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll

鹏飞万里 | 园豆:202 (菜鸟二级) | 2019-12-31 10:11
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册