Open peder1896 opened 2 years ago
Try this as an example. You may need to downgrade the package version in csproj file and add additional nuget sources in nuget.config https://github.com/mattleibow/SkiaSharpBlazorWebAssembly
Thank you artemiusgreat i did as you suggested and downloaded the project, it worked perfect. I then took a look in the csproj file and realised i had not included the following in the PropertyGroup
<TargetFramework>net6.0</TargetFramework>
<Nullable>enable</Nullable>
<WasmBuildNative>true</WasmBuildNative>
and this in the ItemGroup
<NativeFileReference Include="$(SkiaSharpStaticLibraryPath)\2.0.23\*.a" />
Now it works in my own project Great
Hi I tried to use skiasharp views in Blazor Wasm on Visual Studio 2022 production . Installed SkiaSharp.Views.Blazor 2.88.0-preview.155 added
and
to razor file Compiled the projeect ran it but get the following error
Unhandled Exception:
System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. ---> System.DllNotFoundException: libSkiaSharp at SkiaSharp.SKImageInfo..cctor() --- End of inner exception stack trace --- at SkiaSharp.Views.Blazor.SKCanvasView.CreateBitmap(SKSizeI& unscaledSize) at SkiaSharp.Views.Blazor.SKCanvasView.OnRenderFrame() at SkiaSharp.Views.Blazor.Internal.ActionHelper.Invoke() at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) --- End of stack trace from previous location --- at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.InvokeSynchronously(JSRuntime jsRuntime, DotNetInvocationInfo& callInfo, IDotNetObjectReference objectReference, String argsJson) at Microsoft.JSInterop.Infrastructure.DotNetDispatcher.Invoke(JSRuntime jsRuntime, DotNetInvocationInfo& invocationInfo, String argsJson) at Microsoft.AspNetCore.Components.WebAssembly.Services.DefaultWebAssemblyJSRuntime.InvokeDotNet(String assemblyName, String methodIdentifier, String dotNetObjectId, String argsJson) Uncaught Error: System.TypeInitializationException: The type initializer for 'SkiaSharp.SKImageInfo' threw an exception. ---> System.DllNotFoundException: libSkiaSharpThe thread 0x5030 has exited with code 0 (0x0).
I have probably missed something Any Idea? Regards Peder