ModelingEvolution.SkiaSharp.Views.Blazor 1.1.16

ModelingEvolution.SkiaSharp.Views.Blazor

Drop-in replacement for SkiaSharp.Views.Blazor with full support for .NET 10 WebAssembly threading (WasmEnableThreads).

Why this package?

The official SkiaSharp.Views.Blazor uses synchronous JS interop (IJSInProcessRuntime, [JSImport]) which crashes at runtime when WASM threading is enabled:

Cannot call synchronous C# methods.
Assertion at mono-threads-wasm.c:201, condition `<disabled>' not met

This package patches all JS interop to use async IJSObjectReference calls (InvokeAsync, InvokeVoidAsync) and fixes SharedArrayBuffer handling in the canvas rendering pipeline.

Installation

dotnet add package ModelingEvolution.SkiaSharp.Views.Blazor

Replace any existing reference to SkiaSharp.Views.Blazor - the namespace and types are identical:

<!-- Remove this -->
<PackageReference Include="SkiaSharp.Views.Blazor" Version="3.119.1" />

<!-- Add this -->
<PackageReference Include="ModelingEvolution.SkiaSharp.Views.Blazor" Version="1.1.8" />

No code changes required. Same namespace (SkiaSharp.Views.Blazor), same types (SKCanvasView, SKGLView, SKPaintSurfaceEventArgs).

What's patched

Area Official This package
JS module loading JSHost.ImportAsync / IJSInProcessRuntime IJSObjectReference via IJSRuntime
JS callbacks invokeMethod() (sync) invokeMethodAsync() (async)
DPI/Size watchers Synchronous start/stop Async StartAsync/StopAsync
Canvas putImageData Direct Module.HEAPU8.buffer Copies out of SharedArrayBuffer when threading enabled
Module access Global Module variable getDotnetRuntime(0).Module fallback for threaded context
Emscripten linker InterceptBrowserObjects via globals Same (kept for AOT compatibility)

Requirements

  • .NET 10.0+
  • SkiaSharp 3.119.1+
  • Blazor WebAssembly (Server-side rendering doesn't need this patch)

COOP/COEP Headers

WASM threading requires SharedArrayBuffer, which needs these response headers:

app.Use(async (context, next) =>
{
    context.Response.Headers["Cross-Origin-Opener-Policy"] = "same-origin";
    context.Response.Headers["Cross-Origin-Embedder-Policy"] = "credentialless";
    await next();
});

License

MIT - same as SkiaSharp.

Showing the top 20 packages that depend on ModelingEvolution.SkiaSharp.Views.Blazor.

Packages Downloads
BlazorBlaze
High-performance 2D canvas engine for Blazor using SkiaSharp. Features include scene graph, hit detection, camera zoom/pan, extensible controls, and reactive data binding.
9
BlazorBlaze
High-performance 2D canvas engine for Blazor using SkiaSharp. Features include scene graph, hit detection, camera zoom/pan, extensible controls, and reactive data binding.
3
BlazorBlaze
High-performance 2D canvas engine for Blazor using SkiaSharp. Features include scene graph, hit detection, camera zoom/pan, extensible controls, and reactive data binding.
2
BlazorBlaze
High-performance 2D canvas engine for Blazor using SkiaSharp. Features include scene graph, hit detection, camera zoom/pan, extensible controls, and reactive data binding.
1

Version Downloads Last updated
1.3.0 1 04/02/2026
1.1.16 8 03/28/2026
1.1.15 2 03/28/2026
1.1.14 4 03/28/2026
1.1.13 1 03/28/2026
1.1.12 2 03/27/2026
1.1.11 2 03/27/2026
1.1.10 2 03/27/2026
1.1.9 2 03/27/2026
1.1.8 3 03/27/2026
1.1.7 1 03/27/2026
1.1.6 2 03/27/2026