2023년 3월 10일 금요일

System.Drawing.Bitmap를 사용할 때 발생하는 "The type initializer for 'Gdip' threw an exception."

닷넷코어에서 Bitmap을 리눅스에.. (정확히는 도커 우분투에서) 실행시
이미지관련 작업을 하다가 위에러를 발견함
gdiplus 관련라이브러리가 없어서 그럼
음.. 리눅스쪽에서는 .net core로 갔더라도 일부 라이브러리는
monoframework관련 라이브러리를 이용해야하는것 같다.
해결방법은 아래와 같음

명령창에서 다음을 순차적으로 실행한다.

apt-get update
apt-get install -y --allow-unauthenticated
apt-get install -y libc6-dev
apt-get install -y libgdiplus
apt-get install -y libx11-dev
rm -rf /var/lib/apt/lists/*



댓글 없음:

댓글 쓰기