tossnet / Blazor-Captcha

Generates a captcha image for a Blazor application
GNU General Public License v3.0
35 stars 8 forks source link

The type initializer for 'SkiaSharp.SKImageInfo' threw an exception #11

Open sdagkas opened 1 year ago

sdagkas commented 1 year ago

Using BlazorCaptcha 1.2.4 in a .NET 6 project results in the following runtime error:

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: The type initializer for 'SkiaSharp.SKImageInfo' threw an 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 BlazorCaptcha.Captcha.BuildRenderTree(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

IonRobu commented 1 year ago

Same error here. Any workaround?

crippledfaith commented 1 year ago

Same here, added SkiaSharp, SkiaSharp.NativeAssets.WebAssembly, still not working. on Webassembly

a-bagherian commented 1 year ago

blazor wasm

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: The type initializer for 'SkiaSharp.SKImageInfo' threw an 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 BlazorCaptcha.Captcha.BuildRenderTree(RenderTreeBuilder builder)

nlpsl202 commented 1 year ago

same here I am using wasm

Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: The type initializer for 'SkiaSharp.SKImageInfo' threw an 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 BlazorCaptcha.Captcha.BuildRenderTree(RenderTreeBuilder builder) in D:\VSO\Blazor-Captcha\BlazorCaptcha\Captcha.cs:line 105 at Microsoft.AspNetCore.Components.ComponentBase.<.ctor>b__6_0(RenderTreeBuilder builder) at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

elshorbagy commented 9 months ago

I'm having the same problem.

tossnet commented 7 months ago

let's hope the SkiaSharp team finds a solution https://github.com/mono/SkiaSharp/issues/2732

nickfortyau commented 4 months ago

Works great in a non-docker environment, as soon as I deployed in AWS ECS in a docker image, I get this error