Closed tomasfil closed 5 months ago
Hi @tomasfil - is there a sample project or a way I could repro this myself? What this tooling does is a normal Publish operation (which should collect all of the correct native assets) and then a re-packaging of the assets from that Publish, so I'd expect native assets to be handled correctly in the general case. It might also help to have an aka.ms/binlog available (though those files may have sensitive data in them).
This is still an issue in .NET 8 and the fix is not obvious so here is what worked for me.. You must add this to your project file - note there is no using statement for the Linux package. Just add it to the .proj file.
<PackageReference Include="SkiaSharp" Version="2.88.6" ExcludeAssets="native" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.6" />
Do not include the Dependencies version - aka
<PackageReference Include="SkiaSharp.NativeAssets.Linux" Version="2.88.6" />
If you have included that previously you must find the published libSkiaSharp.so
file and delete it from the publish folder otherwise it does not get replaced with the correct one.
Publish again and it should work.
@ghhv Thanks you got me on the right track with that.... I have to include another one though to get mine working
<PackageReference Include="SkiaSharp" Version="2.88.6" ExcludeAssets="native" />
<PackageReference Include="SkiaSharp.NativeAssets.Linux.NoDependencies" Version="2.88.6" />
<PackageReference Include="HarfBuzzSharp.NativeAssets.Linux" Version="7.3.0" />
Thanks @ghhv - @tmitchel2 that cover it for you?
All good with me @baronfel
I'm using mcr.microsoft.com/dotnet/aspnet:6.0 AS base
FROM mcr.microsoft.com/dotnet/aspnet:6.0 AS base and adding this line to the Dockerfile
RUN apt-get update && apt-get install -y libfontconfig1
Solve the problem using SkiaSharp.NativeAssets.Linux(2.88.7) and SkiaSharp.NativeAssets.Linux.NoDependencies (2.88.7)
Hello,
We are trying to use this library, but if we publish to docker, it is not correctly loading SkiaSharp.NativeAssets.Linux.NoDependencies resulting into below exception.