Skip to content

Building with the WebGpu feature fails with MSB4062 for DetectWebGpuUsage_v0 in a CI-built Uno.Sdk #25336

Closed

Description

@MartinZikmund

Current behavior 🐛

Adding the WebGpu feature to UnoFeatures fails the build when the Uno.Sdk comes from a CI-built package (such as a locally built or dev-feed Uno.Sdk):

error MSB4062: The "Uno.Sdk.Tasks.DetectWebGpuUsage_v0" task could not be loaded from the assembly ...\Uno.Sdk_<commit-sha>.dll.

The failing target is _UnoWebGpuDetectUsage in Uno.WinUI.Composition.WebGpu.NativeTrim.targets.

Expected behavior 🎯

The task resolves and the build succeeds, as for the other Uno.Sdk tasks.

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

Confirmed by code inspection of the build scripts; the failure itself was observed with a locally built Uno.Sdk package.

  1. Build the Uno.Sdk and Uno.WinUI.Composition.WebGpu packages through the repo's package build (build/Uno.UI.Build.csproj, which runs the UpdateTasksSHA target).
  2. Create an app that consumes them and set <UnoFeatures>...;Skia;WebGpu;</UnoFeatures>.
  3. Build the app.

Workaround

Redefine an empty _UnoWebGpuDetectUsage target in Directory.Build.targets. The wgpu native payload is then always kept (no trimming), and both the Skia and WebGPU backends run.

Root cause

  • Task classes and the SDK assembly are versioned with a _v0 suffix. UpdateTasksSHA replaces the text v0 with the commit SHA in a fixed list of files, which includes src\Uno.Sdk\**\* (Uno.UI.Build.csproj#L46-L72). This turns DetectWebGpuUsage_v0 into DetectWebGpuUsage_<sha> and Uno.Sdk_v0.dll into Uno.Sdk_<sha>.dll.
  • The UsingTask for the WebGPU detection task lives outside that list, in the WebGpu package: Uno.WinUI.Composition.WebGpu.NativeTrim.targets#L16. It keeps the literal Uno.Sdk.Tasks.DetectWebGpuUsage_v0 and points AssemblyFile at $(UnoSdkTasksAssembly) (Uno.Common.targets#L5), which does get rewritten and exists. The Exists() guard therefore passes, the class name never matches, and the task fails to load.
  • Every other task registration (Uno.AppLaunch.targets, Uno.Implicit.Packages.targets) sits under src/Uno.Sdk and is rewritten together with its class.

UpdateTasksSHA runs unconditionally from PrepareBuildAssets, so I expect any CI-built Uno.Sdk to hit this, not only local builds. Only a build straight from a source checkout (no SHA replacement) would not.

Suggested fix

Either add the NativeTrim targets file to _Sha1Replace in build/Uno.UI.Build.csproj, or move the UsingTask into a targets file under src/Uno.Sdk so it is rewritten together with the class.

Works on UWP/WinUI

N/A (Uno.Sdk build infrastructure).

Environment

Uno.Sdk built from the repo (7.0.0-dev), net10.0-desktop, .NET SDK 10.0.400. Source inspected at 0599dad.

Affected platforms

Any head that names WebGpu (observed on Skia desktop).

Activity

  1. added
    kind/bug
    triage/untriaged
    area/build
    difficulty/starter 🚀
    area/sdk
    7.0
    on Oct 12, 2026
  2. self-assigned this
    on Oct 19, 2026
  3. added a commit that references this issue on Oct 23, 2026
  4. added a commit that references this issue on Oct 23, 2026
    4e7c68d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

7.0area/buildarea/sdkdifficulty/starter 🚀kind/bugtriage/untriaged

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions