Repository navigation
feat(sdk)!: Resolve platform targeting from the target framework - #24087
MartinZikmund wants to merge 18 commits into
Conversation
|
Claude finished @MartinZikmund's task in 6m 48s —— View job Review Complete
Verdict: ship (with minor fixes)3 inline findings — 1 low-severity correctness/readability, 2 test coverage gaps. No logic bugs found. Cross-cutting observationsArchitecture — correct direction.
Deleted files — verified rationale.
Documentation — thorough. Validation gap (acknowledged by author): iOS/tvOS and WinAppSDK heads were not validated locally due to missing .NET 11 SDK. CI screenshots pending. These are standard pre-merge gates. |
There was a problem hiding this comment.
Pull request overview
This PR changes Uno Platform’s platform-targeting model so platform/XAML prefix/file-suffix resolution follows the target framework (TFM) rather than internal runtime identifiers. It also removes now-dead legacy UI-layer files, updates SDK/source-generator build logic, adds first automated tests for Uno.UI.Tasks, and documents the migration and new diagnostic UNOB0020.
Changes:
- Make Uno.Sdk cross-targeting and source generator conditional XAML namespace inclusion/exclusion TFM-driven (including new
desktop:/tvos:behavior and revisedskia/netstdrefsemantics). - Remove the non-runtime-enabled package rewrite logic from
RuntimeAssetsSelectorTaskand addUNOB0020validation viaRuntimeAssetsValidatorTask. - Add a new
Uno.UI.Tasks.TestsMSTest project and wire it into solution filters/CI scope; update docs/specs for the breaking change.
Reviewed changes
Copilot reviewed 43 out of 43 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Uno.UI/UI/Xaml/ILayouterElement.cs | Deleted dead conditional layout helper code. |
| src/Uno.UI/UI/Xaml/Controls/TimePicker/TimePicker.native.cs | Deleted Uno-only DP now made unreachable by new targeting rules. |
| src/Uno.UI/UI/Xaml/Controls/TextBox/TextBoxView.stub.cs | Removed obsolete unit-test/reference stub. |
| src/Uno.UI/UI/Xaml/Controls/Primitives/CarouselPanel.cs | Removed unused panel type guarded by dead conditions. |
| src/Uno.UI/UI/Xaml/Controls/ListViewBase/NativeListViewBase.cs | Removed native-renderer bridging type no longer reachable. |
| src/Uno.UI/UI/Xaml/Controls/ListViewBase/ListViewBaseScrollContentPresenter.cs | Removed native scroll presenter bridge no longer reachable. |
| src/Uno.UI/UI/Xaml/Controls/Layouter/Layouter.cs | Deleted large legacy layouter implementation behind dead guards. |
| src/Uno.UI/UI/Xaml/Controls/ItemsWrapGrid/ItemsWrapGridLayout.cs | Removed dead ItemsWrapGrid layout implementation. |
| src/Uno.UI/UI/Xaml/Controls/ItemsWrapGrid/ItemsWrapGrid.cs | Removed dead ItemsWrapGrid implementation behind dead guards. |
| src/Uno.UI/UI/Xaml/Controls/ItemsStackPanel/ItemsStackPanel.NotImplemented.cs | Removed dead NotImplemented partial behind dead guards. |
| src/Uno.UI.slnx | Added new Uno.UI.Tasks.Tests project to solution definition. |
| src/Uno.UI-UnitTests-only.slnf | Included Uno.UI.Tasks.Tests in the unit-tests solution filter. |
| src/Uno.Sdk/targets/Uno.CrossTargeting.targets | Make .crossruntime.cs/.skia.cs and wasm suffix handling TFM-driven; define crossruntime as “not WinAppSDK”. |
| src/Uno.Sdk/targets/Uno.Common.Wasm.targets | Define __WASM__ based on net*-browserwasm TFMs. |
| src/Uno.Sdk/targets/Uno.Common.Desktop.targets | Define __DESKTOP__ for any net*-desktop project (including libraries). |
| src/SourceGenerators/Uno.UI.Tasks/RuntimeAssetsValidator/RuntimeAssetsValidatorTask.cs | Add platform-asset validation and improve UnoUIRuntimeIdentifier stamp reading; introduce UNOB0020 warning. |
| src/SourceGenerators/Uno.UI.Tasks/RuntimeAssetsSelector/RuntimeAssetsSelectorTask.cs | Remove non-runtime-enabled package “Skia mobile” rewrite branch; keep platform assets intact. |
| src/SourceGenerators/Uno.UI.Tasks.Tests/Uno.UI.Tasks.Tests.csproj | New MSTest project for Uno.UI.Tasks in-process task testing. |
| src/SourceGenerators/Uno.UI.Tasks.Tests/Given_RuntimeEnabledPackage.cs | Tests two-layer runtime selection behavior for runtime-enabled packages. |
| src/SourceGenerators/Uno.UI.Tasks.Tests/Given_RuntimeAssetsValidatorTask.cs | Tests UNOB0020 behavior and UnoUIRuntimeIdentifier stamp matching. |
| src/SourceGenerators/Uno.UI.Tasks.Tests/Given_RuntimeAssetsSelectorTask.cs | Tests that platform-specific assets are preserved across platforms. |
| src/SourceGenerators/Uno.UI.Tasks.Tests/Directory.Build.targets | Ensures MSBuild runtime assets are available to the test host. |
| src/SourceGenerators/Uno.UI.Tasks.Tests/AssemblyFixture.cs | Adds Cecil-authored NuGet-cache fixtures and a recording MSBuild engine for tests. |
| src/SourceGenerators/Uno.UI.SourceGenerators/Content/Uno.UI.SourceGenerators.props | Make conditional XAML namespace prefixes resolve from TFM; add desktop/tvos support; redefine “Uno-rendered” vs WinAppSDK. |
| src/SourceGenerators/Uno.UI.SourceGenerators.Tests/UnoAssemblyHelper.cs | Remove reference-assembly loading paths now that Reference flavor is gone for these UI assemblies. |
| src/SamplesApp/SamplesApp/SamplesApp.csproj | Removes outdated comment about generator ordering/runtime-identifier dependency. |
| src/AddIns/Uno.UI.Lottie/LottieVisualSource.reference.cs | Deleted orphan reference-only implementation file. |
| specs/058-dead-conditional-branches/spec.md | New proposal documenting dead #if branches post-targeting changes. |
| specs/057-preprocessor-constant-cleanup/spec.md | New proposal documenting preprocessor symbol cleanup taxonomy. |
| specs/056-platform-targeting-vocabulary/spec.md | New proposal defining future platform-targeting vocabulary post-change. |
| specs/051-samplesapp-unosdk-skia/plan.md | Update historical note to reflect removal of the old rewrite lever. |
| specs/043-drop-native-rendering/spec.md | Amendment documenting removal of non-runtime-enabled asset rewrite and UNOB0020. |
| doc/articles/uno-build-error-codes.md | Document new UNOB0020 warning and suppression property. |
| doc/articles/platform-specific-xaml.md | Update conditional XAML prefix semantics to be TFM-driven; document deprecated aliases. |
| doc/articles/platform-specific-csharp.md | Update guidance for libraries vs heads under new asset selection model. |
| doc/articles/migrating-to-uno-7.md | Add migration guidance for multi-targeted libraries and new targeting behavior. |
| doc/articles/guides/how-to-create-control-libraries.md | Update library-targeting guidance under new asset selection behavior. |
| doc/articles/features/using-the-uno-sdk.md | Update suffix table and explain new .crossruntime.cs / .skia.cs behavior. |
| doc/articles/features/using-skia-rendering.md | Update explanation for platform-specific assets in libraries; reference UNOB0020. |
| build/nuget/uno.winui.runtime-replace.targets | Wire RuntimeAssetsValidatorTask inputs + opt-out property; stop passing unused selector inputs. |
| build/ci/scripts/determine-test-scope.ps1 | Expand TemplateTestsRequired scope to include Uno.UI.Tasks changes. |
| .claude/rules/platform-targeting.md | Document scope separation: repo-internal targeting vs consumer-facing Uno.Sdk targeting. |
| .claude/rules/build-system.md | Update build-system rule to reflect selector no longer rewrites third-party platform assets. |
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
|
The build 227924 found UI Test snapshots differences: Details
|
|
|
|
|
|
Claude finished @MartinZikmund's task in 8m 11s —— View job Review Complete
Verdict: ship (pending CI green)2 inline findings — both informational/nit; no logic bugs found. All 4 findings from the previous review pass are confirmed fixed in What was reviewedReviewed the full 17-commit branch (
Previous findings — all resolved
New inline findings (this pass)
CI failures — attention neededScreenshot diffs (73 Linux, 123 Windows from build 227924): These failures were reported before Docs build failure (build 227925): Also pre- Cross-cutting observations
23/23 tests green per author validation; |
| <!-- | ||
| Every target framework Uno Platform provides is rendered by Uno itself; only the WinAppSDK one is | ||
| rendered by WinUI. Note this does not name a drawing backend: Uno.UI compiles once and selects its | ||
| backend at runtime. |
There was a problem hiding this comment.
The old guard was '$(UnoRuntimeIdentifier)'=='Skia' or … =='WebAssembly' or … =='Reference' — which only fired when a runtime package was present, so it was false for class libraries. The new default-true / WinAppSDK-false means every non-WinAppSDK project now compiles *.skia.cs and *.crossruntime.cs, including -android, -ios, -tvos libraries. That is the stated intent and is documented in the breaking-change migration guide — flagging here so reviewers can confirm there are no remaining .skia.cs files in the tree that contain code only valid on desktop (the three remaining Uno.UI/…/…HighContrast.skia.cs files are safe: they only reference types that are available on all platforms).
| @@ -89,9 +88,20 @@ | |||
| </Target> | |||
|
|
|||
| <Target Name="_UnoValidateReferencesUnoRuntimeIdentifier" BeforeTargets="CoreCompile"> | |||
There was a problem hiding this comment.
_UnoValidateReferencesUnoRuntimeIdentifier runs BeforeTargets="CoreCompile" with no condition, so it fires for every project that imports this targets file — including net10.0-desktop and net10.0-browserwasm heads. The UNOB0020 check exits early inside CreatePlatformAssetValidator for non-mobile TargetPlatformIdentifier values (it logs MessageImportance.Low and returns null), so there is no correctness issue. Worth calling out in case you want to add a narrow target-level Condition to avoid iterating RuntimeCopyLocalItems on builds where the validator can never fire, e.g.:
<Target Name="_UnoValidateReferencesUnoRuntimeIdentifier"
BeforeTargets="CoreCompile"
Condition="'$(UnoRuntimeIdentifier)' != '' OR '$(UnoUIRuntimeIdentifier)' != ''">This is a performance nit, not a correctness issue.
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24087/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24087/docs/index.html |
|
The build 227948 found UI Test snapshots differences: Details
|
efac312 to
bb320f0
Compare
|
Claude finished @MartinZikmund's task in 3m 51s —— View job Review Complete
Verdict: ship (pending CI green)No new blocking findings. All 5 findings from the previous review pass ( What was reviewed this passTwo commits since the previous review sign-off at
CI screenshot diffs — pre-existing, not a regressionBuild 227948 still reports 73 Linux / 113 Windows screenshot diffs across the same set of controls ( One remaining open nit (non-blocking)
|
|
🤖 Your WebAssembly Skia Sample App stage site is ready! Visit it here: https://unowasmprstaging.z20.web.core.windows.net/pr-24087/wasm-skia-net9/index.html |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24087/docs/index.html |
|
The build 228408 found UI Test snapshots differences: Details
|
Cross-references every symbol defined in a DefineConstants element against every symbol branched on in src, and sorts the asymmetry by cause: 47 defined and never used, 77 used and never defined once SDK-provided and file-local symbols are subtracted. The useful part is the taxonomy rather than the lists -- consumer-facing symbols, developer diagnostics, ported-code parking, vendored sources and MUX conventions all look identical to dead code in a raw diff, and deleting on the raw lists would break working code. Three typos fall out of it, each reading as a live condition that can never be true: #if __ANDROID missing its trailing underscores, #if WinUI against a symbol spelled WINUI, and #if !DESKTOP against __DESKTOP__. The first is indistinguishable from the ported-code parking pattern, which is why that pattern needs one reserved spelling. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01PTBMNbcPLwzdYrtPzY8s9Z
Evaluates every #if and #elif in the single-flavor projects against the define set MSBuild actually produces, rather than inferring it, and honours file-local defines. Files compiled into more than one project are excluded, and configuration-dependent symbols are never folded -- a Debug dump would otherwise mark every #if DEBUG as constant. src/Uno.UI carries 356 always-false and 643 always-true conditionals, but the actionable set is much smaller than that: IS_UNIT_TESTS and __NETSTD_REFERENCE__ account for most of the deletable half, while the always-true half is dominated by #if HAS_UNO, which marks Uno's deviations from the upstream WinUI sources and is the provenance the porting rules exist to preserve. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01PTBMNbcPLwzdYrtPzY8s9Z
markdownlint MD028 fails the docs build when two blockquotes are separated only by a blank line. Merge the two consecutive notes, and move the tip above the paragraph it supports. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
- Spell the DEL character as an escape so the sanitizer is legible. - Tolerate UnauthorizedAccessException in the fixture cleanup. - Assert the selector's add-lists are empty where the test claims the assets are untouched. - Cover ios and tvos heads for UNOB0020, and desktop and an unset identifier for the negative case. - Document the *skia XAML prefix aliases in the migration guide. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01GP2BeVCQzY3sQB7QBv173u
The CI `UpdateTasksSHA` target renames the MSBuild task classes to carry the build SHA, but the substitution list never covered `Uno.UI.Tasks.Tests`, so the unit tests stage failed to compile against the renamed types. Isolate the versioned names in a single alias file and add that file to the list. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_017MKZkUqyoXz1ggvvfPEQvC
e2732b3 to
ec43a5d
Compare
|
Claude finished @MartinZikmund's task in 5m 49s —— View job Review Complete
Verdict: ship (pending CI screenshot investigation)No new blocking findings. The two commits since the previous review sign-off ( What was reviewed this passFull diff against
Previous findings — all confirmed resolved
One remaining acknowledged nit (non-blocking)
CI screenshot diffs — unresolved, recommend investigation before mergeBuild 229231 reports 73 Linux / 190 Windows diffs. The Windows count has climbed across every CI run (123 → 113 → 102 → 172 → 190 across 5 runs), which is more than random flakiness. For Skia desktop specifically, That said, the growing count (73 stable on Linux, 190 and rising on Windows) is unusual. The affected pages — |
|
🤖 Your Docs stage site is ready! Visit it here: https://unodocsprstaging.z13.web.core.windows.net/pr-24087/docs/index.html |
|
The build 229429 found UI Test snapshots differences: Details
|
The type-name sanitizer compared against a literal U+007F byte embedded in the source, which is invisible in review and depends on the file surviving an encoding round-trip. Spell it as an escape instead. Carried over from #24087, which is otherwise already merged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011vgZ3cDuKKFqDCPDLpWSPu
UNOB0020 was only exercised for an android head and only rejected for browserwasm; it now runs for ios and tvos, and the negative case covers desktop and an unset identifier. The selector tests claimed the assets were untouched while asserting only the remove-lists. PackageCacheFixture cleanup also tolerates UnauthorizedAccessException, which Windows raises instead of IOException when a handle is still open. Carried over from #24087, which is otherwise already merged. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_011vgZ3cDuKKFqDCPDLpWSPu
|
Closing this as superseded rather than rebasing it — it is 219 commits behind What was checked.
What was carried over, into #24089 (same base branch):
Verified with Nothing else from this branch is outstanding. |
Pull request was closed
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
The Uno.WinUI package shipped two MSBuild files that only a legacy, non-`Uno.Sdk` project could reach: - `uno.winui.single-project.targets`, imported when `$(SingleProject)` is true — the 5.1-and-earlier single-project layout, since superseded by the Uno.Sdk's own `Uno.DefaultItems.SingleProject` / `Uno.ProjectCapabilities.SingleProject` / `Uno.SingleProject.*` targets. - `uno.winui.win.targets`, shipped only into the `uap10.0.*` buildTransitive folders. The package carries no `lib/uap10.0.*` assets and no `uap10.0` dependency group, so a UWP head already resolved nothing from it. A new UNOB0021 error replaces them for application heads, so a legacy project gets one actionable diagnostic pointing at the migration guide instead of a wall of missing-target failures. It can only see `OutputType`, so an executable that merely links Uno.WinUI trips it too — `UnoDisableUNOB0021Validation` opts out, mirroring the existing `UnoDisableUNOB0002Validation`. Libraries keep building from a plain `Microsoft.NET.Sdk` project, and WinAppSDK heads are untouched — that path does not import `uno.winui.common.targets`. UNOB0020 is deliberately skipped: PR #24087 claims it for the runtime-asset validator. Co-Authored-By: Claude Opus 5 (1M context) <[email protected]> Claude-Session: https://claude.ai/code/session_01TkmzHzEzSGmbD66HKNhQHi
GitHub Issue: part of #8339
PR Type:
💥 Breaking change (build / platform targeting)
What changed? 🚀
The platform axis now follows the target framework, for class libraries and application heads alike. Previously it was derived from the internal runtime identifiers, which produced three separate defects:
android:/ios:/wasm:XAML prefixesXamarinProjectTypewas overwritten withskiaon every mobile and WebAssembly targettvos:/desktop:XAML prefixes*.skia.cs,*.crossruntime.csUnoRuntimeIdentifier, which onlynetX.0-desktopsets — so both were silently an alias of*.desktop.cs__DESKTOP__net*-desktopproject__WASM__net*-browserwasmprojectlib/<tfm>-ios|android|tvosassetlib/<tfm>asset, for both compile and runtimeThe runtime identifiers (
UnoRuntimeIdentifier,UnoUIRuntimeIdentifier,UnoWinRTRuntimeIdentifier) are deliberately untouched — they still drive theUno.WinRT/Uno.Foundationtwo-layer runtime asset selection, and settingUnoRuntimeIdentifieron mobile would switch that machinery out of two-layer mode.Asset selection.
RuntimeAssetsSelectorTask.HandleSkiaMobileForNonRuntimeEnabledPackagesis removed. It existed becauseUno.WinUIused to ship a nativeUno.UIunderlib/<tfm>-ios|android, which made a library's platform asset incompatible with a Skia head.Uno.WinUInow ships no platform-specificlib/folder at all, so every asset binds the sameUno.UIand the substitution has nothing left to correct.Because a package built against an earlier
Uno.UIis now deployed rather than quietly swapped out,RuntimeAssetsValidatorTaskreports the newUNOB0020when a kept platform asset referencesUno.UItypes that no longer exist. It is opt-out throughUnoDisableUNOB0020Validationand documented inuno-build-error-codes.md.While in that task, its
UnoUIRuntimeIdentifierlookup now matches on the metadata key rather than on whicheverAssemblyMetadataattribute came first — the SDK emits its own (RepositoryUrl,IsTrimmable) ahead of Uno's, which made the check a no-op for most published packages.Cleanup. Ten files under
src/Uno.UIwrapped end to end in a guard that can no longer be true, plus the orphanLottieVisualSource.reference.cs, are deleted (1378 lines).Tests. First coverage for the
Uno.UI.TasksMSBuild tasks: 19 tests driving them in-process against Cecil-authored NuGet-cache fixtures, including theUno.WinRTtwo-layer swap that a plainnetX.0library depends on, which had none.Specs. Three follow-up proposals are included as design artifacts only — they change no code:
specs/056-platform-targeting-vocabulary/spec.md— which prefixes, suffixes and symbols should still existspecs/057-preprocessor-constant-cleanup/spec.md— the remaining constantsspecs/058-dead-conditional-branches/spec.md— the#ifbranches that can no longer be takenPR Checklist ✅
src/SourceGenerators/Uno.UI.Tasks.Tests(19 tests), wired intoUno.UI-UnitTests-only.slnfplatform-specific-xaml.md,platform-specific-csharp.md,using-the-uno-sdk.md,using-skia-rendering.md,how-to-create-control-libraries.md,uno-build-error-codes.md,migrating-to-uno-7.mdScreenshots Compare Test Runresults — pending CIBreaking change impact and migration
Who is affected: applications and libraries that use conditional XAML prefixes, the platform file suffixes, or that reference multi-targeted NuGet packages on an iOS/Android/tvOS head.
Impact and migration:
android:,ios:andwasm:markup now applies on the matching target framework instead of being dropped, and thenot_forms no longer apply there. Markup written against the old behaviour — in particularnot_android:ornot_ios:used to mean "everywhere" — resolves differently. Re-test conditional XAML in multi-targeted libraries.skia:additionally applies on a plainnetX.0target framework, where it was previously false.not_skia:correspondingly stops applying there.*.skia.csand*.crossruntime.csnow compile on every target framework except the WinAppSDK one. A file that was genuinely desktop-only should be renamed to*.desktop.cs; otherwise aFoo.skia.cs+Foo.Android.cspair produces duplicate definitions on-android.net*-ios/-android/-tvosassembly is now what the matching head compiles against and deploys. Recompile Uno-dependent libraries against 7.0 — a stale asset now fails at run time instead of being silently replaced, and the build reportsUNOB0020where it can detect this.All four are covered in
doc/articles/migrating-to-uno-7.md, which gains a "Platform targeting in multi-targeted libraries" section and a migration-checklist entry.Validation
Uno.UI.Tasksbuilds clean; 19/19 new tests pass.-androidasset is kept where it was previously rewritten tolib/net10.0, andUNOB0020fires naming the removed type.SamplesAppbuilds clean fornet10.0-android,net10.0-browserwasmandnet10.0-desktop;Uno.UIandUno.UI.Lottiebuild clean after the deletions.Uno.UI-Skia-only.slnfbuild (a project pinsnet11.0and no .NET 11 SDK is installed on this machine),dotnet pack/Uno.PackageDiff, iOS/tvOS, and WinAppSDK.🤖 Generated with Claude Code
https://claude.ai/code/session_01PTBMNbcPLwzdYrtPzY8s9Z