2

I'm stucked since I meet the famous "Unable to load DLL 'libSkiaSharp' or one of its dependencies: The specified module could not be found. (0x8007007E)".

I'm running my asp.net core application within a windows docker image. My project is under .net 6.0

enter image description here

here is my dockerfile :

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS base
ENV DOTNET_VERSION=5.0.0
ENV ASPNETCORE_URLS=https://+:55003
ENV ASPNETCORE_ENVIRONMENT=Development
WORKDIR /app
EXPOSE 55003

FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build
WORKDIR /src
COPY ["Medsoft.Hair.PatientService/Medsoft.Hair.PatientService.csproj", "Medsoft.Hair.PatientService/"]
#COPY ["Medsoft.Hair.PatientService/Dependencies/opengl32.dll", "c:/Windows/System32/opengl32.dll"]
#COPY ["Medsoft.Hair.PatientService/Dependencies/glu32.dll", "c:/Windows/System32/glu32.dll"]
RUN dotnet restore "Medsoft.Hair.PatientService/Medsoft.Hair.PatientService.csproj"
COPY . .
WORKDIR "/src/Medsoft.Hair.PatientService"
RUN dotnet build "Medsoft.Hair.PatientService.csproj" -c Release -o /app/build

FROM build AS publish
RUN dotnet publish "Medsoft.Hair.PatientService.csproj" -c Release -o /app/publish

FROM base AS final
WORKDIR /app
COPY --from=publish /app/publish .
ENTRYPOINT ["dotnet", "Medsoft.Hair.PatientService.dll"] 

Before the first "FROM" of the dockerfile was "mcr.microsoft.com/dotnet/aspnet:6.0" but with this my image doens't have any .net sdk installed. But it doesn't help here.

When I do dotnet --info on the image running, i have this :

.NET SDK (reflecting any global.json): Version: 6.0.400 Commit:
7771abd614

Runtime Environment: OS Name: Windows OS Version: 10.0.17763 OS Platform: Windows RID: win10-x64 Base Path: C:\Program Files\dotnet\sdk\6.0.400\

global.json file: Not found

Host: Version: 6.0.8 Architecture: x64 Commit:
55fb7ef977

.NET SDKs installed: 6.0.400 [C:\Program Files\dotnet\sdk]

.NET runtimes installed: Microsoft.AspNetCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.AspNetCore.App] Microsoft.NETCore.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.NETCore.App] Microsoft.WindowsDesktop.App 6.0.8 [C:\Program Files\dotnet\shared\Microsoft.WindowsDesktop.App]

Download .NET: https://aka.ms/dotnet-download

Learn about .NET Runtimes and SDKs:
https://aka.ms/dotnet/runtimes-sdk-info

Looks like I have.net SDK loaded or installed. Others nugets as pomelo (mysql) are working like this.

Maybe I'm missing some redist to install ? My skiasharp version is 2.88.1.

I also added skiasharp native windows nuget as recommanded

What do I miss here? Someone can help ? If more information is needed, I'll provide it !

Iainh
  • 33
  • 4
  • I am not sure, but maybe this docker image doesn't support Skia or it is not installed. Try to get another image with a SO. – Lucas Simas Aug 30 '22 at 14:19
  • Thanks Lucas, you mean a .so file ? I never used it atm xD – Iainh Aug 30 '22 at 14:43
  • Duplicate of https://stackoverflow.com/questions/53693042/dllnotfoundexception-using-skiasharp-1-68-on-linux? – Matt Thalman Aug 30 '22 at 20:53
  • Have you tried installing `libfontconfig1`? If you do not have rights to install packages, or other reasons not to install , you can simply use `libfontconfig1` [SkiaSharp.NativeAssets.Linux.NoDependencies](https://www.nuget.org/packages/SkiaSharp.NativeAssets.Linux.NoDependencies). – Chen Sep 02 '22 at 07:40
  • Ok thanks for both of you, I'll try it. I hope it's a duplicate, but I'm on windows images, not linux. i'm not sure it will be easy to change from windows images to linux images. But I think It could be a good point to do so, no ? Since I'm in asp net core and microsoft, I prefered windows images in order to have some dependencies pre installed and make the whole deployment easier. but Maybe I'm wrong – Iainh Sep 06 '22 at 12:50

0 Answers0