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
posted @ 2018-12-13 17:20  Robbery  阅读(...)  评论(... 编辑 收藏