找不到gdiplus.dll
发布于 3/10/2020 9:42:42 PM   188次围观  0条评论
发表于 3/10/2020 9:42:42 PM   188人围观  0条评论
转载https://blog.csdn.net/qq_32688731/article/details/100035104 你在windows上使用图像组件没有任务问题,但部署到linux之后,将注意以下几点: 安装nuget包ZKWeb.System.Drawing 项目里还是引用System.DrawingCore,这点不用改 安装gdiplus插件,这个需要根据linux类型不同,有不同的方法,大叔做了一下总结 安装gdiplugs的方法 大叔总结的方法 ubuntu && debian ```shell sudo apt-get install libgdiplus cd /usr/lib sudo ln -s libgdiplus.so gdiplus.dll ``` centos ``` yum whatprovides libgdiplus && yum install -y epel-release && yum install -y libgdiplus-2.10-9.el7.x86_64 && yum install -y libgdiplus-devel ``` 官方提供的方法: Ubuntu 16.04: ``` apt-get install libgdiplus cd /usr/lib ln -s libgdiplus.so gdiplus.dll ``` Fedora 23: ``` dnf install libgdiplus cd /usr/lib64/ ln -s libgdiplus.so.0 gdiplus.dll ``` CentOS 7: ``` yum install autoconf automake libtool yum install freetype-devel fontconfig libXft-devel yum install libjpeg-turbo-devel libpng-devel giflib-devel libtiff-devel libexif-devel yum install glib2-devel cairo-devel yum install git git clone https://github.com/mono/libgdiplus cd libgdiplus yum -y install ftp ./autogen.sh yum -y install gcc automake autoconf libtool make yum -y install gcc gcc-c++ make make install cd /usr/lib64/ ln -s /usr/local/lib/libgdiplus.so gdiplus.dll ``` Docker: ``` RUN apt-get update RUN apt-get install -y libgdiplus RUN cd /usr/lib RUN sudo ln -s libgdiplus.so gdiplus.dll ``` 例子 ``` FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-stretch-slim AS base WORKDIR /app EXPOSE 80 FROM mcr.microsoft.com/dotnet/core/sdk:2.2-stretch AS build RUN apt-get update RUN apt-get install -y libgdiplus RUN cd /usr/lib RUN sudo ln -s libgdiplus.so gdiplus.dll WORKDIR /src COPY ["DC_MMS_API/DC_MMS_API.csproj", "DC_MMS_API/"] COPY ["Core/Core.csproj", "Core/"] COPY ["Infrastructure/Infrastructure.csproj", "Infrastructure/"] RUN dotnet restore "DC_MMS_API/DC_MMS_API.csproj" COPY . . WORKDIR "/src/DC_MMS_API" RUN dotnet build "DC_MMS_API.csproj" -c Release -o /app FROM build AS publish RUN dotnet publish "DC_MMS_API.csproj" -c Release -o /app FROM base AS final WORKDIR /app COPY --from=publish /app . ENTRYPOINT ["dotnet", "DC_MMS_API.dll"] ```
立即登录,发表评论
没有帐号?立即注册
{{$.post.CommentNum}} 条评论