Skip to content

[Uno.Sdk] SkiaRenderer adds Uno.WinUI.Graphics2DSK to WinAppSDK-only libraries #25570

Closed

Description

@mikernet

Current behavior 🐛

DisableImplicitUnoWinAppSdkPackages keeps a library's Windows App SDK target (net*-windows10*) free of the base Uno packages. That way WinAppSDK-only consumers don't get Uno.WinUI, and a strong-named Windows build keeps a fully strong-named dependency chain. A library that lists the legacy SkiaRenderer feature for its Uno targets still gets Uno.WinUI.Graphics2DSK and SkiaSharp.Views.WinUI on Windows, and Uno.Toolkit.Skia.WinUI too with the Toolkit feature: Uno.Features.targets maps skiarenderer to skia on every target framework.

Uno.WinUI.Graphics2DSK then becomes a NuGet dependency of the library's Windows group, so WinAppSDK-only consumers get it. And as Uno assemblies are not strong-named, a strong-named Windows build no longer has a fully strong-named dependency chain. The token chose a renderer, which does not apply to WinAppSDK, and the library never asked for SKCanvasElement on Windows.

Separately, on master, when a project sets TargetFramework in its body instead of being an inner build of TargetFrameworks, skia is implied on Windows even without any feature. Uno.Features.targets tests IsWinAppSdk, which is only set later, by Uno.Common.WinAppSdk.targets.

Expected behavior 🎯

  • In a WinAppSDK-only library (DisableImplicitUnoWinAppSdkPackages), SkiaRenderer adds none of the Skia packages on Windows, whether the property is set in the project or in a Directory.Build.targets. An explicit Skia still adds them there, and the library's Uno targets still map SkiaRenderer to Skia.
  • Heads, and libraries without the property, keep mapping SkiaRenderer to Skia on Windows, as feat(drawing)!: Factory seams, Skottie in the Skia backend, Svg/Lottie docs #25117 intends.
  • Nothing implies skia on a WinAppSDK target framework, whether TargetFramework comes from TargetFrameworks or from the project.

How to reproduce it (as minimally and precisely as possible) 🔬

<Project Sdk="Uno.Sdk">
  <PropertyGroup>
    <TargetFrameworks>net10.0;net10.0-windows10.0.19041</TargetFrameworks>
    <UnoSingleProject>true</UnoSingleProject>
    <OutputType>Library</OutputType>
    <IsPackable>true</IsPackable>
    <DisableImplicitUnoWinAppSdkPackages>true</DisableImplicitUnoWinAppSdkPackages>
    <UnoFeatures>SkiaRenderer</UnoFeatures>
  </PropertyGroup>
</Project>

dotnet pack lists Uno.WinUI.Graphics2DSK and SkiaSharp.Views.WinUI in the dependencies of the net10.0-windows10.0.19041 group.

For the second case, use <TargetFramework>net10.0-windows10.0.19041</TargetFramework> and remove UnoFeatures: dotnet msbuild -getItem:PackageReference lists the same two packages.

Workaround 🛠️

Leave the renderer feature out of UnoFeatures on Windows:

<UnoFeatures Condition="$([MSBuild]::GetTargetPlatformIdentifier('$(TargetFramework)')) != 'windows'">SkiaRenderer</UnoFeatures>

On master, removing SkiaRenderer also works, as Skia is implied on Uno Platform targets, but the 7.0 migration guide says the entry can stay, and the library templates add it.

Affected platforms 📱💻🖥️

Windows App SDK, Build tasks

Uno.Sdk version (and other relevant versions) 📦

master. On 6.7 and 6.8, SkiaRenderer adds Uno.WinUI.Graphics2DSK on Windows too (its condition is skia OR skiarenderer OR IsDesktop), but not SkiaSharp.Views.WinUI or Uno.Toolkit.Skia.WinUI. The single-target case exists only on master: 6.x implies skia nowhere, and the IsWinAppSdk check came with #25117.

IDE version 🧑‍💻

N/A (command line)

Anything else we need to know? 💬

The Windows reference dates from #21059, which made SKCanvasElement available on every target. #25117 stopped implying skia on WinAppSDK and kept mapping SkiaRenderer to skia there, so that a legacy entry still brings SKCanvasElement to a Windows head. That stays as it is for heads: this only concerns libraries that opted out of the Uno packages on Windows.

Activity

  1. mikernet commented on Nov 12, 2026

    @mikernet
    ContributorAuthor

    Fixed on master by #25614, which makes a library ignore SkiaRenderer on every target (with UNOB0030) and tests the target framework instead of IsWinAppSdk, and by #26105, which turns Skia off on the WinAppSDK target unless UnoEnableSkiaOnWinAppSdk is set. A WinAppSDK-only library no longer gets Uno.WinUI.Graphics2DSK on its Windows build.

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions