Repository navigation
Description
Current behavior 🐛
A WinAppSDK head packs ~16 MB of Skia and ANGLE native binaries per architecture, even when the app never draws with Skia on Windows:
| File (x64) | Size | Brought in by |
|---|---|---|
libSkiaSharp.dll |
11.07 MB | Uno.WinUI.Graphics2DSK → SkiaSharp → SkiaSharp.NativeAssets.Win32 (every app) |
libGLESv2.dll |
4.90 MB | SkiaSharp.Views.WinUI (added for the Svg, Lottie or Skia features) |
libEGL.dll, SkiaSharp.Views.WinUI.Native.* |
0.4 MB | same |
Trimming can't remove native DLLs. In a trimmed build the managed SkiaSharp.dll, SkiaSharp.Views.Windows.dll and Uno.WinUI.Graphics2DSK.dll are all removed as unreferenced, but the natives stay, with nothing left that could load them.
On a blank app (dotnet new unoapp -preset blank -platforms windows, trimmed, framework-dependent WinAppSDK), libSkiaSharp.dll is 86% of the difference from an equivalent plain WinUI 3 app (36.1 MB vs 23.3 MB installed). On a real app with Svg it's 16.4 MB of a 70 MB install. It's multiplied by 3 in an x86/x64/arm64 bundle, and the Store listing shows the installed size.
Expected behavior 🎯
A WinAppSDK head only carries Skia natives when the app actually uses Skia on Windows (the Skia feature or SKCanvasElement).
How to reproduce it (as minimally and precisely as possible) 🔬
dotnet new unoapp -preset blank -platforms windows, and addSvgtoUnoFeaturesto also get ANGLE.msbuild -restore /p:TargetFramework=net10.0-windows10.0.26100 /p:Configuration=Release /p:Platform=x64 /p:GenerateAppxPackageOnBuild=true /p:PublishTrimmed=true- Open the
.msix:libSkiaSharp.dll(andlibGLESv2.dll/libEGL.dllwithSvg) are there, whileSkiaSharp.dllhas been trimmed away.
Root cause:
Uno.Features.targetsalways addsskiarenderertoUnoFeatures, soUno.WinUI.Graphics2DSKis referenced for every TFM, WinAppSDK included. On master it's unconditional inUno.Implicit.Packages.ProjectSystem.targets(9ec7524 removed theskiarenderergate, which was always true anyway). Itsnet9.0-windows10.0.19041.0dependency group bringsSkiaSharp.Uno.Implicit.Packages.ProjectSystem.WinAppSdk.targetsaddsSkiaSharp.Views.WinUIwhenskia,lottieorsvgis on. WinUI renders SVG natively (SvgImageSource), soSvgdoesn't need SkiaSharp views on Windows.
Suggested fix: reference Uno.WinUI.Graphics2DSK on WinAppSDK only when the app opts in, and drop svg (and lottie, if Uno's Lottie doesn't use SkiaSharp there) from the SkiaSharp.Views.WinUI condition.
Workaround 🛠️
Leave Svg out on Windows, and drop the Skia native after package resolution. This is only safe if nothing uses SkiaSharp on Windows:
<UnoFeatures Condition="'$(IsWinAppSdk)' != 'true'">$(UnoFeatures);Svg</UnoFeatures>
<Target Name="DropUnusedSkiaNative" AfterTargets="ResolvePackageAssets" Condition="'$(IsWinAppSdk)' == 'true'">
<ItemGroup>
<NativeCopyLocalItems Remove="@(NativeCopyLocalItems)" Condition="'%(Filename)' == 'libSkiaSharp'" />
</ItemGroup>
</Target>Verified on a real app: 70.0 MB → 53.6 MB installed. The app runs, and SVG images still render through WinUI.
Renderer 🎨
- Skia
- Native
Affected platforms 📱💻🖥️
Windows App SDK
Uno.Sdk version (and other relevant versions) 📦
Uno.Sdk 6.6.0-dev.196 (Uno.WinUI 6.6.0-dev.1303, SkiaSharp 3.119.2); the same logic is on master as of 2026-09-21. Microsoft.WindowsAppSDK 1.7.250909003, .NET SDK 10.0.401, net10.0-windows10.0.26100.
IDE version 🧑💻
Command-line MSBuild (Visual Studio 18 Insiders build tools); not IDE-specific.
Anything else we need to know? 💬
Found while cutting down the Microsoft Store package of an Uno app (252 MB installed per architecture). The related Windows App SDK bundling default is #24578, and the trimming crash that blocks the size win is #24577.
Activity
MartinZikmund commentedon Sep 22, 2026
It's worse when the WinAppSDK head is packaged from the
dotnet publishoutput, which is whatwinapp packagedoes.SkiaSharp.NativeAssets.Win32shipslibSkiaSharp.pdbas a native runtime asset, so it arrives throughNativeCopyLocalItemsnext to the DLL and ends up inside the MSIX:libSkiaSharp.pdblibSkiaSharp.dllThat's the single largest item in a template app's package, from a library nothing on Windows uses. (MSBuild's own MSIX packaging splits symbols into
.msixsym, which is why the first report didn't show it.)The workaround from the issue removes both, since
%(Filename)matches the DLL and the PDB alike. With it, a framework-dependent Windows App SDK and partial trimming, the same package is 49.5 MB installed.fix: Drop the unused Skia native library and its PDB from the Windows…
fix: Drop the unused Skia native library and its PDB from the Windows…
fix: Drop the unused Skia native library and its PDB from the Windows…
fix: Drop the unused Skia native library and its PDB from the Windows…
fix: Drop the unused Skia native library and its PDB from the Windows…
fix: Drop the unused Skia native library and its PDB from the Windows…
fix: Drop the unused Skia native library and its PDB from the Windows…
fix: Drop the unused Skia native library and its PDB from the Windows…
fix: Drop the unused Skia native library and its PDB from the Windows…
fix: Drop the unused Skia native library and its PDB from the Windows…