-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
ERROR:The type initializer for 'Gdip' threw an exception on Ubunto server #27200
Comments
Did you try without doing this step? This shouldn't be necessary as we do search for libgdiplus.so in Unix. We only try to load gdiplus.dll when running in Windows. |
First tried without
but it didn;t work so used above solution but none of them work either. |
Could you try adding this path to
And also could you confirm that libgdiplus.so is present under /usr/lib? If that doesn't work, would you mind running a little c app just to see if you can load libgdiplus there? #include <dlfcn.h>
#include <stdio.h>
int main(void)
{
void* ptr = dlopen("libgdiplus.so", 0x002);
printf("Found: %s\n", ptr != 0 ? "yes" : "no");
return 0;
} |
@softsan any luck? |
Sorry for late reply. |
Ok, I just wanted to understand what was happening to fix it if it was a real product issue. I'm pretty sure that setting the Will close the issue in the meantime, please feel free to re-open and I'm sorry you where hitting this. |
Hey Noob question: do I need to restart server or something else? (I just restarted the service by running dotnet run) I tried to run your code And here is the result |
Did you try installing libgdiplus? And also could you confirm that libgdiplus.so is present under /usr/lib? What OS is your server running? |
Hi, I've got the same problem.
The type initializer for 'Gdip' threw an exception. I'll try to use CoreCompact.System.Drawing as softsan wrote |
Installed libc6-dev and everything works |
Have you installed libc6-dev on linux? For me it was the problem. |
Got same issue: BTW, it's working fine on my local Windows 10 when debugging, but does not working on CentOS. |
Fixed |
In case someone is running into the same issue: on macOS, I had the "The type initializer for 'Gdip' threw an exception." exception despite having The reason was that my target framework was already |
In my case on Raspbian running: |
I have tried all of the solutions above, but none seem to have worked for me yet. I'm running an Ubuntu Mini 18.04 server, using System.Drawing.Common 4.7.0, have installed libgdiplus AND libc6-dev, rebooted the server and still am getting the same Exception. Have been working on this all day, haven't been able to crack it yet. Help would be appreciated :D Edit: My application creates Bitmaps from a png source (logo). Judging by the TODO list of the people behind libgdiplus, that is a feature yet to be implemented: https://github.com/mono/libgdiplus/blob/master/TODO |
Can confirm that In a fresh ubuntu 18.04 with dotnetcore 3.1, System.Drawing.Common package 4.7.0 |
I'm running at mac os 10.15.4, using System.Drawing.Common 4.7.0, |
Same problem here on macOS 10.15.5, using |
.net Core 3.1 | Docker | alpine-3.1.1 | linux container on windows and then
But.. it only works when ssh into container! It won't work for me inside the dockerfile. |
I'm getting similar too. |
Was running into this issue inside my docker container. |
For anyone else having this issue in the mcr.microsoft.com/dotnet/core/aspnet:3.1 image, lonwern/aspnetcore-libgdiplus appears to fix the issue with
|
Tried using
System.Drawing.Common
package for my .net core web api project. It runs fine under windows but on ubunto (which is my host server), it throws following errors:This is the method i used to generate thumbnail:
Already installed
sudo apt-get install libgdiplus
and did this too:
So Any workaround or thoughts on this?
The text was updated successfully, but these errors were encountered: