# Epplus於linux環境下無預設lib的報錯與解決 Epplus為.NET眾所皆知的Excel讀取與寫入函式庫 在利用此函式庫撰寫相關功能報表並於Windows環境下測試與呈現結果皆是正常的. 然而把sevice app於linux docker的容器環境下run在此功能會丟出: ``` the type initializer for 'gdip' threw an exception. ``` ## 原因: 經查詢的錯誤原因為.NET的System.Drawing.dll內部依賴了 **gdiplus.dll** , 而gdiplus.dll在Windows的環境上操作系統會自帶此dll,而在Mac和linux系統是沒有相關預設只能自己去添加 ## 解決: 於app所在的docker內更新並安裝此lib再重啟該功能的app便可以正常運作 1.進入到docker 2.RUN **apt-get update && apt-get install -y libgdiplus** 3.重啟app ## source: [Unable to load shared library “libgdiplus” - Docker [ .NET application with Aspose API]](https://stackoverflow.com/questions/59080331/unable-to-load-shared-library-libgdiplus-docker-net-application-with-aspo) [【asp.net core】macOS Gdip 報錯](https://blog.csdn.net/weixin_40590984/article/details/104246112) ###### tags: `netcore` `linux` `docker` `eeplus`
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up