Can't find libSkiaSharp when creating SKBitmap C#

DiamondKesha 31 Reputation points
2022-05-07T16:59:14.507+00:00

Hello. When i trying create SKBitmap i get error -
199839-zkyvvl9ubrlavddx4vgj79uenf-fx4tpm-f4hibfyvtl7yraxd.jpg

I'm try use older and newest version of SkiaSharp, but it didn't help. How i can fix this problem?
I'm use Balzor WebAssembly .Net Core 6.

Blazor
Blazor
A free and open-source web framework that enables developers to create web apps using C# and HTML being developed by Microsoft.
1,496 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Zhi Lv - MSFT 32,096 Reputation points Microsoft Vendor
    2022-05-09T03:00:02.783+00:00

    Hi @DiamondKesha ,

    You can refer to this sample: SkiaSharp on Blazor Web Assembly

    In the Blazor WebAssembly application, try to add the following in the PropertyGroup:

    <PropertyGroup>  
    	<TargetFramework>net6.0</TargetFramework>  
    	<Nullable>enable</Nullable>  
    	<WasmBuildNative>true</WasmBuildNative>  
    </PropertyGroup>  
    

    and add this in the ItemGroup:

    <ItemGroup>  
    	<NativeFileReference Include="$(SkiaSharpStaticLibraryPath)\2.0.23\*.a" />  
    </ItemGroup>  
    

    The SkiaSharp version is 2.88.0-preview.145 version.


    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.

    Best regards,
    Dillion