問題描述
若您有使用 .NET Core QRCoder 套件 或 相關繪圖套件,內部有使用 gdiplus 套件,部屬於 Linux Containerer 時有可能遇到下列問題:
Unable to load shared library 'gdiplus' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: libgdiplus: cannot open shared object file: No such file or directory...
解決方法
若部屬在 Azure App Service On Linux ,你可以在 App Service > 組態 > 執行命令,輸入
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update && apt-get install -y apt-utils libgdiplus libc6-dev && dotnet api.dll |
倘若不是透過 App Service,是透過其他 Container Service,您可以在 dockerfiles 內加入:
RUN apt-get update && apt-get install -y libgdiplus
RUN apt-get update && apt-get install -y libgdiplus
你的 dokcerfile 長的如下 (來源:Unable to load shared library “libgdiplus” - Docker [ .NET application with Aspose API])
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mcr.microsoft.com/dotnet/core/aspnet:3.0 AS base | |
RUN apt-get update && apt-get install -y libgdiplus | |
WORKDIR /app | |
FROM mcr.microsoft.com/dotnet/core/sdk:3.0 AS build | |
... |
0 留言