System.DllNotFoundException

Shashank Sivakoti 1 Reputation point
2022-11-20T15:50:30.073+00:00

Hi Team,

How to resolve this issue.

<PackageReference Include="Microsoft.Maui.Graphics.Skia" Version="7.0.49" />

Error:
The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. Unable to load shared library 'libSkiaSharp' or one of its dependencies. In order to help diagnose loading problems, consider setting the LD_DEBUG environment variable: Error loading shared library liblibSkiaSharp: No such file or directory

I am using netstandard2.1 project, Docker.

.NET MAUI
.NET MAUI
A Microsoft open-source framework for building native device applications spanning mobile, tablet, and desktop.
2,869 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Wenyan Zhang (Shanghai Wicresoft Co,.Ltd.) 26,316 Reputation points Microsoft Vendor
    2022-11-21T06:37:39.43+00:00

    Hello @SrinuNani ,

    SkiaSharp.NativeAssets.Linux and SkiaSharp.NativeAssets.Linux.NoDependencies are not supported with MAUI. You could check the Frameworks part in the NuGet Package links, the compatible target frameworks do not include net6.0-android , net6.0-ios, net6.0-maccatalyst, net6.0-windows, you can use SkiaSharp.Views instead in MAUI.

    Since you add the dotnet-aspnet-core-general tag for this thread, you may want to use SkiaSharp in a BlazorWebView. If you have any other issues, please feel free to let me know.

    Best Regards,
    Wenyan Zhang


    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.