Repository navigation
fix(sdk): Respect a Windows SDK version or preview the project picks (backport #26276) - #26277
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 10s —— View job Review of #26277 (backport of #26276)Verdict: ship. No inline findings (0 issues). The change guards the default
|
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
carldebilly
left a comment
There was a problem hiding this comment.
Approving the backport. The same follow-up applies here as on the main PR: two NETSDK1230 cases remain (Directory.Build.targets, UseWindowsSDKPreview). See #26276 (review) for details and a tested fix. Uno.Sdk.After.targets exists on release/stable/7.0, so the change cherry-picks as is.
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 19s —— View job Review of #26277 (backport of #26276)Verdict: ship. There are no inline findings (0 blocker, 0 major, 0 minor). I read the current diff, which now includes the follow-up. I did not build it or run the template tests.
|
|
Same follow-up folded in here (b672ec8), see #26276 (comment). Same files and tables as #26276. |
carldebilly
left a comment
There was a problem hiding this comment.
Backport matches #26276 line for line. LGTM.
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
GitHub Issue: related to #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.Backport of #26276 to
release/stable/7.0, so the first public 7.0 Uno.Sdk carries it.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code