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

Unhandled exception during the execution: The type initializer for 'Gdip' threw an exception. #12

Open
nabeelmhd opened this issue Apr 3, 2023 · 3 comments

Comments

@nabeelmhd
Copy link

Fingers10.ExcelExport works fine on my windows machine, but when run in docker container, I have an exception which says

Unhandled exception during the execution: The type initializer for 'Gdip' threw an exception.

How do I resolve this ?

@fingers10
Copy link
Owner

@nabeelmhd This is because you are running your app inside Linux container. You need to install few apks in your docker image build step to resolve this error. This is not packager related. Refer below link for solution or try googling on similar error. The fix should be added in docker image build.

https://stackoverflow.com/questions/67091719/system-drawing-common-the-type-initializer-for-gdip-threw-an-exception

@can123oz
Copy link

can123oz commented May 23, 2023

Im also running the app in the linux container, working just fine in my w10 local env, but when i deploy my app to the test env, that excel download api wont work. returns cors error from react but from swagger returns Error: Internal Server Error. My .net version is 6. should i change my docker image too

@fingers10
Copy link
Owner

fingers10 commented May 23, 2023

@can123oz does this help? - https://stackoverflow.com/a/73055366/10851213

This is because of System.Drawing in non windows environment.

@can123oz I resolved by doing this in my docker file - https://stackoverflow.com/questions/60934639/install-fonts-in-linux-container-for-asp-net-core/76332225#76332225

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

3 participants