Skip to content

Fix restore failures from duplicate and vulnerable package versions - #200

Merged
matt-edmondson merged 1 commit into
mainfrom
fix/restore-package-version-conflicts
Aug 5, 2026
Merged

Fix restore failures from duplicate and vulnerable package versions#200
matt-edmondson merged 1 commit into
mainfrom
fix/restore-package-version-conflicts

Conversation

@matt-edmondson

Copy link
Copy Markdown
Contributor

Summary

dotnet build was failing at restore for two independent reasons.

NU1506 — duplicate PackageVersion items (CrossRepoActions.Test)

Directory.Packages.props pinned seven Microsoft.Testing.Extensions.* packages, but MSTest.Sdk 4.3.3 injects its own PackageVersion for every extension it references under central package management. CodeCoverage (18.9.0 vs. pinned 17.14.2) and TrxReport (2.3.3 vs. pinned 1.7.2) collided.

All seven entries are removed. This is safe because MSTest.Sdk always pairs each injected PackageReference with a matching PackageVersion, and the ktsu.Sdk KTSU0005 orphan analyzer explicitly skips the Microsoft.Testing.Extensions. prefix. The supported lever for controlling these versions is the MicrosoftTestingExtensions*Version properties, not PackageVersion entries.

NU1903 — high-severity vulnerability (both projects)

System.Security.Cryptography.Xml 10.0.6 arrives transitively via Microsoft.PowerShell.SDK / System.Management.Automation and carries five advisories. Pinned forward to 10.0.10, with an explicit PackageReference in CrossRepoActions.csproj so KTSU0005 does not flag the version as orphaned. The test project picks it up through its ProjectReference.

Test plan

  • dotnet build — succeeds, 0 warnings, 0 errors
  • dotnet test — 15/15 passed

🤖 Generated with Claude Code

https://claude.ai/code/session_014zdo5ANWj1oVmu3dHVZsuf

…rsions

Remove the Microsoft.Testing.Extensions.* PackageVersion entries. MSTest.Sdk
injects its own PackageVersion for every extension it references under central
package management, so the repo-side pins collided with the SDK-owned versions
and failed restore with NU1506. KTSU0005 explicitly skips this package prefix,
so nothing else depended on them.

Pin System.Security.Cryptography.Xml forward to 10.0.10. It arrives
transitively via Microsoft.PowerShell.SDK / System.Management.Automation at
10.0.6, which carries five high-severity advisories and failed restore with
NU1903.
@sonarqubecloud

sonarqubecloud Bot commented Aug 5, 2026

Copy link
Copy Markdown

@matt-edmondson
matt-edmondson merged commit bf39308 into main Aug 5, 2026
5 checks passed
@github-project-automation github-project-automation Bot moved this to Done in ktsu.dev Aug 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

1 participant