Skip to content

Fix NU1009 CPM conflict for xunit.v3.core#16608

Merged
steveisok merged 1 commit intodotnet:mainfrom
steveisok:fix/xunitv3-cpm-nu1009
Mar 19, 2026
Merged

Fix NU1009 CPM conflict for xunit.v3.core#16608
steveisok merged 1 commit intodotnet:mainfrom
steveisok:fix/xunitv3-cpm-nu1009

Conversation

@steveisok
Copy link
Copy Markdown
Member

Problem

Arcade commit 3290ea9 ("Add xunitv3assert #16555") introduced a NuGet Central Package Management (CPM) conflict:

  • XUnitV3.targets defines xunit.v3.core as an implicit PackageReference (IsImplicitlyDefined="true") with Version set directly
  • Directory.Packages.props also defines a <PackageVersion Include="xunit.v3.core"> entry

NuGet CPM rule: implicit PackageReferences cannot have a corresponding <PackageVersion> entry — they must set Version directly on the <PackageReference> item. This results in NU1009 on any project that imports XUnitV3.targets.

This breaks the Ubuntu2404_Ubuntu_BuildTests_x64 leg (the only leg running with /p:DotNetBuildTests=true) in the unified-build pipeline.

Failing build: https://dev.azure.com/dnceng-public/public/_build/results?buildId=1341950

Fix

  1. Remove the redundant <PackageVersion Include="xunit.v3.core"> from Directory.Packages.props
  2. Mark the direct reference in XUnitAssert.Tests.csproj as implicit with an inline Version — this project sets DisableArcadeTestFramework=true so it doesn't get the targets-based reference and needs its own version

Validation

Both XUnitV3Extensions.csproj and XUnitAssert.Tests.csproj restore cleanly after the fix. No other .csproj files in the repo have direct xunit.v3.core references.

XUnitV3.targets defines xunit.v3.core as an implicit PackageReference
(IsImplicitlyDefined=true) with Version set directly. NuGet CPM forbids
implicit references from also having a <PackageVersion> entry in
Directory.Packages.props — this caused NU1009 on any project importing
the targets (e.g., Ubuntu2404_Ubuntu_BuildTests_x64 leg).

Fix:
- Remove the redundant <PackageVersion Include="xunit.v3.core"> from
  Directory.Packages.props
- Mark the direct reference in XUnitAssert.Tests.csproj as implicit with
  an inline Version, matching the pattern from XUnitV3.targets (this
  project sets DisableArcadeTestFramework=true so doesn't get the
  targets-based reference)

Regression introduced by arcade commit 3290ea9 ("Add xunitv3assert
dotnet#16555").

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@steveisok steveisok requested review from agocke, lewing and mmitche March 18, 2026 22:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants