The type initializer for 'SkiaSharp.SKImageInfo' threw an exception
这个错误表明在 Linux 系统上初始化 SkiaSharp 的 SKImageInfo
类型时出现了问题。以下是完整的解决方案:
安装系统依赖:
# Ubuntu/Debian
sudo apt-get update
sudo apt-get install -y libfontconfig1 libharfbuzz0b libfreetype6# CentOS/RHEL
sudo yum install -y fontconfig harfbuzz freetype
Nuget包安装:
dotnet add package SkiaSharp.NativeAssets.Linux --version 2.88.3
最后运行成功:二维码/条形码工具