documentation/packages.md
Reference for all NuGet packages produced by SkiaSharp — purpose, contents, and usage guidance.
Related: Adding Libraries | Architecture | Linux Assets
These contain the managed C# assemblies. The SkiaSharp and HarfBuzzSharp core packages automatically include the appropriate NativeAssets for most platforms (see Auto-Included NativeAssets). For Linux, WebAssembly, NanoServer, and WinUI you must add the NativeAssets package manually.
| Package | Description |
|---|---|
| SkiaSharp | Cross-platform 2D graphics API. Managed C# bindings to Google's Skia library. Core types: SKCanvas, SKPaint, SKBitmap, SKImage, SKPath, SKSurface. Includes .NET Interactive support (embedded DLL for Polyglot Notebooks). |
| HarfBuzzSharp | Managed C# bindings to the HarfBuzz text shaping engine. Provides Buffer, Font, Face for complex text layout. |
| SkiaSharp.HarfBuzz | Integration bridge — adds HarfBuzz text shaping to SkiaSharp via SKShaper. Depends on both SkiaSharp and HarfBuzzSharp. |
| SkiaSharp.Skottie | Lottie/Bodymovin animation playback. Renders After Effects animations. Depends on SkiaSharp, SkiaSharp.SceneGraph, and SkiaSharp.Resources. |
| SkiaSharp.SceneGraph | Scene graph API for complex rendering pipelines. Depends on SkiaSharp. Used by Skottie internally. |
| SkiaSharp.Resources | Resource provider implementations. Depends on SkiaSharp. Used by Skottie for asset loading. |
Platform-specific UI controls for rendering SkiaSharp content. These provide ready-to-use views/controls that handle the platform-specific rendering surface setup.
| Package | Description |
|---|---|
| SkiaSharp.Views | Platform views for iOS, tvOS, macOS, Mac Catalyst, Android, and Tizen. Provides SKCanvasView and SKGLView. |
| SkiaSharp.Views.Desktop.Common | Common base classes for desktop views (netstandard2.0+, net462+). |
| SkiaSharp.Views.WindowsForms | Windows Forms controls: SKControl, SKGLControl. net462+ and net6.0-windows+. Depends on OpenTK. |
| SkiaSharp.Views.WPF | WPF control: SKElement. net462+ and net6.0-windows+. Depends on OpenTK. |
| SkiaSharp.Views.WinUI | WinUI 3 controls: SKXamlCanvas, SKSwapChainPanel. net6.0-windows+. Depends on Microsoft.WindowsAppSDK. Auto-includes SkiaSharp.NativeAssets.WinUI. |
| SkiaSharp.Views.Gtk3 | GTK# 3 control: SKDrawingArea. netstandard2.0+. For Linux desktop apps. Depends on GtkSharp. |
| SkiaSharp.Views.Blazor | Blazor WebAssembly controls: SKCanvasView, SKGLView. net6.0+. Auto-includes SkiaSharp.NativeAssets.WebAssembly. |
| SkiaSharp.Views.Maui.Core | .NET MAUI shared view infrastructure. net8.0+. Depends on Microsoft.Maui.Core. |
| SkiaSharp.Views.Maui.Controls | .NET MAUI controls: SKCanvasView, SKGLView. net8.0+. Depends on SkiaSharp.Views.Maui.Core and Microsoft.Maui.Controls. |
| SkiaSharp.Views.Uno.WinUI | Uno Platform controls: SKXamlCanvas, SKSwapChainPanel. net8.0+. Depends on Uno.WinUI. Auto-includes SkiaSharp.NativeAssets.WebAssembly for WASM targets and SkiaSharp.Views.WinUI for Windows targets. |
Optional packages for hardware-accelerated rendering via specific GPU APIs.
| Package | Description |
|---|---|
| SkiaSharp.Vulkan.SharpVk | Vulkan GPU backend. netstandard2.0+, net462+, net6.0+. Depends on SharpVk 0.4.2. |
| SkiaSharp.Direct3D.Vortice | Direct3D 12 GPU backend. net8.0 only. Windows-only due to Vortice.Direct3D12 3.5.0 dependency. |
Each platform has a pair of NativeAssets packages containing pre-built native binaries:
SkiaSharp.NativeAssets.{Platform} — contains libSkiaSharpHarfBuzzSharp.NativeAssets.{Platform} — contains libHarfBuzzSharpBoth follow the same platform matrix and architectures. HarfBuzzSharp does not have Linux.NoDependencies, NanoServer, or WinUI variants.
Important: Library projects should depend on
SkiaSharponly. NativeAssets packages belong in the application (executable) project so the correct binary is deployed. See Deployment & Containers.
| Package | Description |
|---|---|
| SkiaSharp.NativeAssets.Win32 | |
| HarfBuzzSharp.NativeAssets.Win32 | Windows (x64, x86, arm64). Auto-included. |
| SkiaSharp.NativeAssets.macOS | |
| HarfBuzzSharp.NativeAssets.macOS | macOS universal binary (Intel + Apple Silicon). Auto-included. |
| SkiaSharp.NativeAssets.Linux | |
| HarfBuzzSharp.NativeAssets.Linux | Linux (x64, x86, arm, arm64, riscv64, loongarch64). Both glibc and musl (Alpine) variants. Must add manually. Requires fontconfig (libfontconfig.so.1) for system font enumeration. |
| SkiaSharp.NativeAssets.Linux.NoDependencies | Linux (same architectures as above, glibc + musl). SkiaSharp only. Must add manually. No fontconfig, no third-party deps — only requires libc/libm/libpthread/libdl. Designed for minimal containers. Fonts must be loaded explicitly. |
| SkiaSharp.NativeAssets.NanoServer | Windows Nano Server containers (x64 only). SkiaSharp only. Must add manually. |
| SkiaSharp.NativeAssets.WinUI | ANGLE rendering surface for WinUI 3 apps (x64, x86, arm64). SkiaSharp only. Contains SkiaSharp.Views.WinUI.Native.dll, libEGL.dll, and libGLESv2.dll for hardware-accelerated OpenGL ES — this is not a Skia binary. Auto-included by SkiaSharp.Views.WinUI. |
| SkiaSharp.NativeAssets.Android | |
| HarfBuzzSharp.NativeAssets.Android | Android (x86, x64, arm, arm64). Auto-included. |
| SkiaSharp.NativeAssets.iOS | |
| HarfBuzzSharp.NativeAssets.iOS | iOS framework bundle (arm64 device + simulator). Auto-included. |
| SkiaSharp.NativeAssets.MacCatalyst | |
| HarfBuzzSharp.NativeAssets.MacCatalyst | Mac Catalyst universal framework bundle. Auto-included. |
| SkiaSharp.NativeAssets.tvOS | |
| HarfBuzzSharp.NativeAssets.tvOS | Apple tvOS framework bundle (arm64, device only). Auto-included. |
| SkiaSharp.NativeAssets.Tizen | |
| HarfBuzzSharp.NativeAssets.Tizen | Samsung Tizen (armel, x86). Auto-included. |
| SkiaSharp.NativeAssets.WebAssembly | |
| HarfBuzzSharp.NativeAssets.WebAssembly | Emscripten static library (.a). Static linking, not P/Invoke — linked into dotnet.wasm at build time via MSBuild NativeFileReference. Includes multiple Emscripten versions with threading (st/mt) and SIMD variants. Must add manually (or use SkiaSharp.Views.Blazor / SkiaSharp.Views.Uno.WinUI). |
⚠️ WASM is NOT dynamic loading. Unlike all other platforms, WebAssembly uses static linking at compile time. The
.afiles are passed to the Emscripten linker which embeds them into the finaldotnet.wasmbinary.DllImport("libSkiaSharp")still works — the .NET WASM runtime resolves it to statically linked symbols.
Unity WebGL: Unity WebGL also uses Emscripten. While not officially supported, the same static linking principle applies. Unity-specific integration may require manual configuration beyond the standard NativeFileReference approach.
The core SkiaSharp and HarfBuzzSharp packages automatically include NativeAssets for most platforms via TFM-conditional dependencies:
| Packages | Auto-included when targeting |
|---|---|
| SkiaSharp.NativeAssets.Win32 | |
| HarfBuzzSharp.NativeAssets.Win32 | Windows TFM (net8.0-windows) or non-platform TFM (net6.0, net8.0, netstandard2.0, netstandard2.1, net462) |
| SkiaSharp.NativeAssets.macOS | |
| HarfBuzzSharp.NativeAssets.macOS | macOS TFM (net8.0-macos) or non-platform TFM (net6.0, net8.0, netstandard2.0, netstandard2.1, net462) |
| SkiaSharp.NativeAssets.Android | |
| HarfBuzzSharp.NativeAssets.Android | Android TFM (net8.0-android) |
| SkiaSharp.NativeAssets.iOS | |
| HarfBuzzSharp.NativeAssets.iOS | iOS TFM (net8.0-ios) |
| SkiaSharp.NativeAssets.MacCatalyst | |
| HarfBuzzSharp.NativeAssets.MacCatalyst | Mac Catalyst TFM (net8.0-maccatalyst) |
| SkiaSharp.NativeAssets.tvOS | |
| HarfBuzzSharp.NativeAssets.tvOS | tvOS TFM (net8.0-tvos) |
| SkiaSharp.NativeAssets.Tizen | |
| HarfBuzzSharp.NativeAssets.Tizen | Tizen TFM (net8.0-tizen) |
Must be added manually (not auto-included):
SkiaSharp.NativeAssets.Linux / HarfBuzzSharp.NativeAssets.Linux — for Linux server/desktopSkiaSharp.NativeAssets.Linux.NoDependencies — for minimal Linux containers (SkiaSharp only)SkiaSharp.NativeAssets.WebAssembly / HarfBuzzSharp.NativeAssets.WebAssembly — for Blazor/Uno WASM. SkiaSharp.NativeAssets.WebAssembly is auto-included by SkiaSharp.Views.Blazor and SkiaSharp.Views.Uno.WinUI; HarfBuzzSharp.NativeAssets.WebAssembly must always be added manually.SkiaSharp.NativeAssets.NanoServer — for Windows Nano Server (SkiaSharp only)SkiaSharp.NativeAssets.WinUI — for WinUI 3 apps (SkiaSharp only; auto-included by SkiaSharp.Views.WinUI)| Scenario | Package | Why |
|---|---|---|
| Standard Linux server/desktop | SkiaSharp.NativeAssets.Linux | Full fontconfig integration for system font access |
| Docker containers (Debian/Ubuntu) | SkiaSharp.NativeAssets.Linux.NoDependencies | No system library dependencies beyond glibc |
| Alpine Docker containers | SkiaSharp.NativeAssets.Linux.NoDependencies | Includes linux-musl-* variants, no deps |
| Minimal/distroless containers | SkiaSharp.NativeAssets.Linux.NoDependencies | Zero third-party deps |
| App needs system font enumeration | SkiaSharp.NativeAssets.Linux | Fontconfig required for SKFontManager system fonts |
NativeAssets packages must be referenced in the application project (the one that produces the executable), not in library projects. The .NET runtime resolves native binaries from the application's output directory using runtime identifiers (RIDs).
If a NativeAssets package is only referenced in a transitive library, the native binary may not be copied to the final output — causing DllNotFoundException at runtime.
For containers, use SkiaSharp.NativeAssets.Linux.NoDependencies unless you specifically need fontconfig for system font enumeration. This package has zero third-party dependencies and works in minimal base images (mcr.microsoft.com/dotnet/aspnet, Alpine, distroless).
| Mode | Native Binary Handling |
|---|---|
| Framework-dependent | Binaries in runtimes/{rid}/native/ resolved at runtime |
| Self-contained | Binaries copied to publish output for the specified RID |
| Single-file | Binaries extracted alongside the executable at runtime |
These packages are no longer actively maintained. Use the listed replacement.
| Package | Replacement |
|---|---|
| SkiaSharp.NativeAssets.UWP | SkiaSharp.NativeAssets.WinUI |
| SkiaSharp.NativeAssets.watchOS | (none — watchOS not supported) |
| HarfBuzzSharp.NativeAssets.UWP | HarfBuzzSharp.NativeAssets.Win32 |
| HarfBuzzSharp.NativeAssets.watchOS | (none) |
| SkiaSharp.Views.NativeAssets.UWP | SkiaSharp.Views.WinUI |
| SkiaSharp.Views.Forms | SkiaSharp.Views.Maui.Controls |
| SkiaSharp.Views.Forms.WPF | SkiaSharp.Views.WPF |
| SkiaSharp.Views.Forms.GTK | SkiaSharp.Views.Gtk3 |
| SkiaSharp.Views.Gtk2 | SkiaSharp.Views.Gtk3 |
| SkiaSharp.Views.Uno | SkiaSharp.Views.Uno.WinUI |
| SkiaSharp.Views.Maui.Controls.Compatibility | SkiaSharp.Views.Maui.Controls |
On Linux, DllNotFoundException errors from dlopen() have two distinct failure modes with different root causes:
| Error pattern | What happened | Fix |
|---|---|---|
libSkiaSharp.so: cannot open shared object file: No such file or directory | The .so file was not found at any search path | Add SkiaSharp.NativeAssets.Linux (or .NoDependencies) as a PackageReference in the executable project, not a library |
libfontconfig.so.1: cannot open shared object file (or another dependency OF libSkiaSharp) | A .so was found and loaded, but it has a dependency that isn't installed | Either install the missing library (e.g. fontconfig) or switch to NoDependencies (see below) |
SkiaSharp.NativeAssets.Linux.NoDependencies ships a .so with zero external dependencies — only libc/libm/libpthread/libdl. If you reference NoDependencies but see errors about missing fontconfig, uuid, or other libraries:
NoDependencies — it's from NativeAssets.Linux (or another source)SkiaSharp.NativeAssets.Linux reference conflicting with NoDependenciesNoDependencies is in the executable project (not a library project)You can verify which binary is loaded by running ldd on the libSkiaSharp.so in your publish output. The NoDependencies variant will show only libc/libm/libpthread/libdl.
The .NET runtime tries multiple paths to load a native library and reports ALL failures. Focus on the first error — subsequent lines are fallback attempts:
System.DllNotFoundException: Unable to load shared library 'libSkiaSharp'
libfontconfig.so.1: cannot open shared object file ← LOOK HERE (binary found, dependency missing)
/usr/share/dotnet/.../libSkiaSharp.so: cannot open ← fallback path, file not found
/app/liblibSkiaSharp.so: cannot open ← fallback path, file not found
| Problem | Cause | Fix |
|---|---|---|
DllNotFoundException: libSkiaSharp | Native binary not in output | Add NativeAssets.Linux.NoDependencies (or .Linux) as a direct PackageReference in the application project |
libfontconfig.so.1: cannot open | Using NativeAssets.Linux in a minimal container | Switch to NoDependencies, or install fontconfig in your Dockerfile |
| Wrong binary for container arch | RID mismatch (glibc vs musl) | Alpine needs linux-musl-* RIDs — NoDependencies includes both glibc and musl variants |
| Trimming removes native deps | .NET trimmer strips unused assemblies | Add the NativeAssets package as a direct PackageReference |