Skip to content

WinAppSDK heads ship ~16 MB of unused Skia/ANGLE native DLLs per architecture #24576

Closed

Description

@MartinZikmund

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) 🔬

  1. dotnet new unoapp -preset blank -platforms windows, and add Svg to UnoFeatures to also get ANGLE.
  2. msbuild -restore /p:TargetFramework=net10.0-windows10.0.26100 /p:Configuration=Release /p:Platform=x64 /p:GenerateAppxPackageOnBuild=true /p:PublishTrimmed=true
  3. Open the .msix: libSkiaSharp.dll (and libGLESv2.dll/libEGL.dll with Svg) are there, while SkiaSharp.dll has been trimmed away.

Root cause:

  1. Uno.Features.targets always adds skiarenderer to UnoFeatures, so Uno.WinUI.Graphics2DSK is referenced for every TFM, WinAppSDK included. On master it's unconditional in Uno.Implicit.Packages.ProjectSystem.targets (9ec7524 removed the skiarenderer gate, which was always true anyway). Its net9.0-windows10.0.19041.0 dependency group brings SkiaSharp.
  2. Uno.Implicit.Packages.ProjectSystem.WinAppSdk.targets adds SkiaSharp.Views.WinUI when skia, lottie or svg is on. WinUI renders SVG natively (SvgImageSource), so Svg doesn'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

  1. added
    kind/bug
    triage/untriaged
    area/sdk
    on Sep 21, 2026
  2. MartinZikmund commented on Sep 22, 2026

    @MartinZikmund
    MemberAuthor

    It's worse when the WinAppSDK head is packaged from the dotnet publish output, which is what winapp package does. SkiaSharp.NativeAssets.Win32 ships libSkiaSharp.pdb as a native runtime asset, so it arrives through NativeCopyLocalItems next to the DLL and ends up inside the MSIX:

    x64, Uno.Sdk 6.7.0-dev.64, SkiaSharp 3.119.2 Size
    libSkiaSharp.pdb 79.95 MB
    libSkiaSharp.dll 11.07 MB
    whole package, installed 187.7 MB

    That'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.

  3. added
    7.1
    on Oct 14, 2026
  4. removed
    7.1
    on Oct 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/sdkkind/bugtriage/untriaged

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions