Repository navigation
fix(sdk): Respect a Windows SDK version or preview the project picks - #26276
Conversation
Since #25836 the Uno.Sdk sets WindowsSdkPackageMinimumRevision to 87 on Windows targets, even when the project already picked WindowsSdkPackageVersion. The .NET SDK rejects both together, so every such project failed with NETSDK1230. The default now applies only when the project picked no version.
|
Claude finished @agneszitte's task in 12s —— View job Review summaryVerdict: ship. No blocking issues. Findings: 0 critical, 0 major, 0 minor. The change is one extra condition on the Cross-cutting notes
|
With #26276 an explicit WindowsSdkPackageVersion wins over the Uno.Sdk default again, so NETSDK1230 no longer happens on a public 7.0 build. What still breaks is a projection older than .87 (the 6.0 guide's .57), which fails with CS1705: remove the property or raise it.
carldebilly
left a comment
There was a problem hiding this comment.
Approving: this fixes the cases reported in #26174 (version set in the csproj, Directory.Build.props, an environment variable or -p:), and nothing that builds today changes behavior.
Two cases of the same bug remain, both confirmed with a real build on .NET SDK 10.0.402. Details and a tested fix are in the inline comment. It's a small move that could be folded into this PR, or into a follow-up if you prefer.
The same change applies to the backport #26277 (identical diff). Uno.Sdk.After.targets exists on release/stable/7.0 too, so it stays a cherry-pick.
Optional, non-blocking:
- Regression coverage:
build/test-scripts/run-netcore-mobile-template-tests.ps1already builds Windows heads through Uno.Sdk. A copy of thenet11.0-windows10.0.26100row (line 238) with-p:WindowsSdkPackageVersion=10.0.26100.87would fail with NETSDK1230 without the fix. - Diagnostics for old pins: a project pinned below
.87now fails with CS1705, and that error doesn't nameWindowsSdkPackageVersion. #26273 documents it. AUNOBwarning when the pinned revision is below 87 could be a later follow-up.
The default WindowsSdkPackageMinimumRevision moves to Uno.Sdk.After.targets, after the .NET SDK and Directory.Build.targets, so a WindowsSdkPackageVersion set there is seen too, and it's skipped with UseWindowsSDKPreview, which the .NET SDK also rejects next to a minimum revision (NETSDK1230). The template tests build a Windows head with an explicit WindowsSdkPackageVersion. From Carl's review. Co-authored-by: Carl de Billy <[email protected]>
|
Claude finished @agneszitte's task in 16s —— View job Review summaryVerdict: ship. No blocking issues. Findings: 0 critical, 0 major, 0 minor. This update moves the
Notes
|
carldebilly
left a comment
There was a problem hiding this comment.
Thanks for the quick turnaround. The default now lives in Uno.Sdk.After.targets with the UseWindowsSDKPreview guard, and the template row covers the explicit-version case. LGTM.
…indows SDK section Matches #26276 after its review: the Uno.Sdk default also steps aside for UseWindowsSDKPreview, and a WindowsSdkPackageVersion set in a Directory.Build.targets file is respected too. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
…kageversion-wins-stable-7.0 fix(sdk): Respect a Windows SDK version or preview the project picks (backport #26276)
GitHub Issue: closes #26174
PR Type:
🐞 Bugfix
What changed? 🚀
Since #25836, the
Uno.SdksetsWindowsSdkPackageMinimumRevisionto87on Windows targets, even when the project already picks a Windows SDK projection. The .NET SDK rejects a minimum revision next toWindowsSdkPackageVersionorUseWindowsSDKPreview, so those projects failed withNETSDK1230. That includes apps that followed the 6.0 migration guide, and Uno.Themes, Uno.Toolkit, Uno.Extensions and Uno.UI.RuntimeTests.Engine while moving to 7.0.29.Uno.Sdk.After.targets, after the .NET SDK andDirectory.Build.targets, so a choice made anywhere in the project is seen. It was inUno.Common.WinAppSdk.targets, which runs beforeDirectory.Build.targets.WindowsSdkPackageVersion, noUseWindowsSDKPreview, no ownWindowsSdkPackageMinimumRevision. Projects that set nothing still get the.87projection.run-netcore-mobile-template-tests.ps1also builds the 5.6 template's Windows head with-p:WindowsSdkPackageVersion=10.0.26100.87, which fails withNETSDK1230without this change.The move to
Uno.Sdk.After.targetsand theUseWindowsSDKPreviewcase come from Carl's review.Validation: a
net10.0-windows10.0.19041.0library that importsUno.Common.WinAppSdk.targets, Microsoft.NET.Sdk andUno.Sdk.After.targetsin the Uno.Sdk order, built withdotnet build(.NET SDK 10.0):WindowsSdkPackageVersionin the projectNETSDK1230WindowsSdkPackageVersionas-p:or environment variableNETSDK1230WindowsSdkPackageVersioninDirectory.Build.targetsNETSDK1230UseWindowsSDKPreview=trueNETSDK1230NETSDK1230(then needs a preview Windows SDK package)WindowsSdkPackageMinimumRevisionEnd to end: a library with
Sdk="Uno.Sdk.Private"(Windows and desktop targets, Uno 7.0.29), built with the published Uno.Sdk.Private 7.0.29 and with a package packed from this branch:WindowsSdkPackageVersionin the projectNETSDK1230WindowsSdkPackageVersioninDirectory.Build.targetsNETSDK1230WindowsSdkPackageVersionas environment variableNETSDK1230UseWindowsSDKPreview=trueNETSDK1230NETSDK1230(then no previewMicrosoft.Windows.SDK.NET.Refto restore, expected)The local package is
7.0.999-local, so theUnoSdkVersionChecktarget was turned off in the test app, asUno.Build.targetssuggests for dev testing.A project that pins a projection older than
.87(the 6.0 guide's.57) still fails withCS1705, because Uno's Windows assemblies need WinRT.Runtime 2.3. The migration guide covers it (#26273). AUNOBwarning naming the property could be a later follow-up.Needs a backport to
release/stable/7.0(#26277), so the first public 7.0 Uno.Sdk carries it.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code