The type initializer for 'gdip' threw an exception on linux ubuntu
Hi There,
I have an asp.net core application for upload image and I deploy it to docker Linux Ubuntu 18, after upload I get an error The type initializer for 'gdip' threw an exception on linux . I Can not upload image on lunix but it working well on local window 10 of my computer.
Pls tell me any solutions.
-
M9
Manish Kumar Feb 18 2020
This error occurs when you using System.Drawing package in .Net but this package is not install on your server. You can install this package through Dockerfile.
Copy this code and paste to the end of your dockerfile.
# install System.Drawing native dependencies RUN apt-get update && apt-get install -y --allow-unauthenticated libc6-dev libgdiplus libx11-dev && rm -rf /var/lib/apt/lists/*
I hope this works for you.
-
M0
Mary Christ Mar 02 2020
Thank many Manish Kumar.
It worked for me.
As me kown this package is managed by Nuget. Can you explain to me why this package is not download when docker build?
* Type maximum 2000 characters.
* All comments have to wait approved before display.
* Please polite comment and respect questions and answers of others.