ASP.Net Core "The type initializer for 'Gdip' threw an exception"

ASP.NET Core项目部署在Linux下可能会出现GDI错误

  1. The type initializer for 'Gdip' threw an exception
    1.   解决方案:创建 libdl 的软链接
      #  /lib/x86_64-linux-gnu/libdl*
      sudo ln -s /lib/x86_64-linux-gnu/libdl.so.2 /lib/x86_64-linux-gnu/libdl.so

      sudo ln -s /lib/x86_64-linux-gnu/libdl-2.xx.so /lib/x86_64-linux-gnu/libdl.so

      #  /lib/x86_64-linux-gnu/libdl*
      sudo ln -s /lib/x86_64-linux-gnu/libdl.so.2 /usr/lib/x86_64-linux-gnu/libdl.so

      sudo ln -s /lib/x86_64-linux-gnu/libdl-2.xx.so /usr/lib/x86_64-linux-gnu/libdl.so
  2. Unable to load DLL 'libgdiplus'
    1.   解决方案:安装 libgdiplus 包
      sudo apt install libgdiplus
      # 有可能还需要创建一个软链接
      sudo ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll
上一篇:pageHelper分页


下一篇:golang bug Unknown load command 0x32 (50)