We are running a .Net core console application on a windows container with Kubernetes (Amazon EKS). The host OS is Windows Sever 2016. Getting the below error when a excel file is generated by Aspose.Cells.
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.
As suggested in this link, tried using the windows image so that GDI library will be available in the container but it didn't work. Below is the docker file ,
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"]
Tried with below images as well, but no luck.
FROM mcr.microsoft.com/dotnet/aspnet:5.0
FROM mcr.microsoft.com/dotnet/sdk:5.0
and
FROM mcr.microsoft.com/windows/servercore:ltsc2019
FROM mcr.microsoft.com/dotnet/runtime:5.0
There are options for linux containers to explicitly install gdiPlus library, couldn't find anything like that for windows containers. At present we are looking to deploy our application only on windows containers. Appreciate any help!