Fix SamplesCompatTest NU1605: insert missing PackageVersion entries when rewriting samples' Directory.Packages.props#6473
Open
v-arlysenko wants to merge 2 commits into
Conversation
…hen rewriting Directory.Packages.props
Scottj1s
approved these changes
May 12, 2026
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
Collaborator
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes an NU1605 build break in
BuildSampleApps_x64/BuildSampleApps_arm64of
TransportPackage-Foundation-Nightly(e.g. build 146281092):Internal work item: AB#62180574
Root cause
test/ModifySampleAppsReferences.ps1rewrites WASDK package versions inWindowsAppSDK-Samples@release/experimentalat pipeline time, using the Foundation transport package's extracted contents as the source of truth.For
Directory.Packages.propsit only replaced existingPackageVersion Include="…" Version="…"entries — it never inserted missing ones. The samples branch doesn't declare aPackageVersionforMicrosoft.WindowsAppSDK.Base, so the script silently did nothing for that package. NuGet restore then resolved Base from the transport-package metadata, picking an older2.0.3-dev.experimental1that conflicts with Foundation's pinned>= 2.0.260223001-experimental→ NU1605.Fix
When rewriting
Directory.Packages.props, if thePackageVersion Include="X"entry is missing, insert<PackageVersion Include="X" Version="…" />into the first<ItemGroup>. Existing entries are still updated in place.packages.confighandling is unchanged; the samples failing in this bug all use central package management. We can add symmetric insert logic later if apackages.configsample hits the same NU1605.Validation
Local dry-run of the script against a clone of
release/experimentalusing the same$packagesToUpdateTablethe pipeline builds: the rewrittenSamples/Directory.Packages.propsnow contains a<PackageVersion Include="Microsoft.WindowsAppSDK.Base" Version="…" />entry matching the Foundation transport package version.Risk
Low — change is confined to a build-time script that runs only inside
TransportPackage-Foundation-Nightlyagainst a cloned samples repo; no shipping code or sample source is modified.