Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

.net core 3.1 can not use System.Drawing.Common on docker #227

Closed
amnotbusy opened this issue Mar 14, 2020 · 7 comments
Closed

.net core 3.1 can not use System.Drawing.Common on docker #227

amnotbusy opened this issue Mar 14, 2020 · 7 comments

Comments

@amnotbusy
Copy link

System.Windows.Extensions types are not supported on this platform.

@codebude
Copy link
Owner

This seems like a general problem with netcore. Let's see what the outcome of the following discussion will be: dotnet/runtime#1011

@pwninstein
Copy link

I was able to get the library to work on a Linux container running netcoreapp3.1 based on the guidance from this answer.

Summary: libgdiplus couldn't be loaded at runtime, so I updated my dockerfile to install the following packages : apt-utils libgdiplus libc6-dev

@codebude
Copy link
Owner

codebude commented Apr 8, 2020

@a57571735 does @pwninstein 's solution solve your problem?

@steven87vt
Copy link

I am considering this package and saw this discussion. I would be interested in knowing as well @a57571735 .

@AlexeiScherbakov
Copy link

Can you try this:

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1.5-buster-slim AS base
RUN apt-get update -y && apt-get install -y libc6-dev libgdiplus libx11-dev && apt-get clean && ln -s /usr/lib/libgdiplus.so /usr/lib/gdiplus.dll
...

@aemloviji
Copy link

@pwninstein answer worked for me. Just adding a sample dockerfile which shows how it need to be defined.

FROM mcr.microsoft.com/dotnet/core/aspnet:3.1 AS base
WORKDIR /app
EXPOSE 80
EXPOSE 443

FROM mcr.microsoft.com/dotnet/core/sdk:3.1 AS build
WORKDIR /src

COPY "solution.sln" "solution.sln"
COPY "Project_1.csproj" "Project_1.csproj"

RUN dotnet restore "solution.sln"

COPY . .
WORKDIR /src/Project_1
RUN dotnet publish --no-restore -c Release -o /app

FROM build AS publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app .

RUN apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev

ENTRYPOINT ["dotnet", "Project_1.dll"]

@codebude
Copy link
Owner

So this seems to be more a Docker/image problem (lib gdi missing), than a problem with QRCoder itself. Thus I'll close the issue. I you have a good idea how to integrate this information into the Wiki pages, let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants