您当前的位置:首页 > 文章 > 处理错误:System.Platform

处理错误:System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.

作者:小象 时间:2022-09-05 阅读数:3024 人阅读

问题:绘制验证码图片程序在本地测试没问题 ,部署到云服务器上之后 提示错误:System.PlatformNotSupportedException: System.Drawing.Common is not supported on this platform.

原因:net core不支持System.Drawing,因为System.Drawing 基于windows的gdi/gdi+库,根本没法移植,被.net core抛弃了。

解决办法:用.net 6 对应系统的runtimes 文件夹里的System.Drawing.Common.dll文件替换就可以了。


上面图片来源于:https://blog.csdn.net/pipi0714/article/details/114639376

资料参考:仅在 Windows 上支持 System.Drawing.Common

本站大部分文章、数据、图片均来自互联网,一切版权均归源网站或源作者所有。

如果侵犯了您的权益请来信告知我们删除。邮箱:1451803763@qq.com

标签:技术