Hi, my project was using System.Drawing.Common to get image size
It's work OK on window, but when I deploy on AWS it throw exception " One or more errors occurred. (The type initializer for 'Gdip' threw an exception.)"
I was research and know I need install "libgdiplus"
But aws can't install libgdiplus
what should I do now ?
There is no way how this could work without libgdi. That is OS dependency .NET needs.
cc: @safern
Hello @godshades... as @wfurt mentioned this can't work without having libgdiplus installed. However, we can resolve libgdiplus in other ways, you can deploy it as part of your app (if that doesn't work, set LD_LIBRARY_PATH env variable to point to the path where libgdiplus is).
Also, if that doesn't meet your expectations or it is too much for what you need, I recommend looking at: https://github.com/SixLabors/ImageSharp it is a completely managed implementation for image manipulation. Our Unix story for System.Drawing was mostly done for compat so the story is not ideal sometimes, however we're looking how to improve in future releases.
I'm going to close this issue, feel free to reopen or keep the discussion going.
For anyone else who comes across this problem and doesn't have the luxury of using an alternative library libgdiplus can be installed through EPEL on Amazon Linux with:
sudo amazon-linux-extras install epel
sudo yum install libgdiplus
I've confirmed this works with Elastic Beanstalk
Most helpful comment
For anyone else who comes across this problem and doesn't have the luxury of using an alternative library libgdiplus can be installed through EPEL on Amazon Linux with:
sudo amazon-linux-extras install epel
sudo yum install libgdiplus
I've confirmed this works with Elastic Beanstalk