【发布时间】:2021-05-10 07:10:45
【问题描述】:
我们正在使用 Kubernetes (Amazon EKS) 的 Windows 容器上运行 .Net 核心控制台应用程序。主机操作系统为 Windows Sever 2016。Aspose.Cells 生成 excel 文件时出现以下错误。
System.TypeInitializationException: The type initializer for 'Gdip' threw an exception. --->
System.DllNotFoundException: Unable to load DLL 'gdiplus.dll' or one of its dependencies:
The specified module could not be found.
正如link 中所建议的那样,尝试使用 Windows 映像以便 GDI 库在容器中可用,但它不起作用。下面是docker文件,
FROM mcr.microsoft.com/windows:1809
FROM mcr.microsoft.com/dotnet/runtime:5.0
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'SilentlyContinue';"]
COPY ./ /App/WS
WORKDIR /App/WS
ENTRYPOINT ["dotnet", "AppService.dll"]
也试过下面的图片,但没有运气。
FROM mcr.microsoft.com/dotnet/aspnet:5.0
FROM mcr.microsoft.com/dotnet/sdk:5.0
和
FROM mcr.microsoft.com/windows/servercore:ltsc2019
FROM mcr.microsoft.com/dotnet/runtime:5.0
Linux 容器有显式安装 gdiPlus 库的选项,在 Windows 容器中找不到类似的东西。目前,我们希望仅在 Windows 容器上部署我们的应用程序。感谢任何帮助!
【问题讨论】:
标签: .net-core gdi+ docker-image windows-container