Skip to content

Centralize NuGet package versions with Directory.Packages.props#1937

Merged
tyrielv merged 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/net10-central-packages
Apr 9, 2026
Merged

Centralize NuGet package versions with Directory.Packages.props#1937
tyrielv merged 1 commit into
microsoft:masterfrom
tyrielv:tyrielv/net10-central-packages

Conversation

@tyrielv
Copy link
Copy Markdown
Contributor

@tyrielv tyrielv commented Apr 8, 2026

Centralize NuGet package versions with Directory.Packages.props

Summary

Enable NuGet Central Package Management across all 18 C# projects. This is the first PR in a phased migration toward .NET 10 with NativeAOT compilation.

What changed

  • New: Directory.Packages.props — single source of truth for all 20 NuGet package versions, plus 3 pre-declared packages for upcoming phases
  • Modified: 17 .csproj files — removed Version= from every <PackageReference> element. Non-version attributes (ExcludeAssets, PrivateAssets, GeneratePathProperty) are preserved.

Review guide

  • Directory.Packages.props — verify each <PackageVersion> matches the Version= that was removed from the corresponding csproj
  • Spot-check 2-3 csproj files to confirm only Version= was removed, nothing else
  • The 3 "Future packages" at the bottom are pre-declared but not yet referenced — they exist to prevent merge conflicts when parallel Phase 2 branches add them

Verification

  • dotnet restore GVFS.sln — all 18 projects restore successfully
  • dotnet build GVFS.sln — all C# projects compile (C++ vcxproj require MSBuild, unchanged)
  • ✅ 793/793 unit tests pass

Context

Part of the .NET 10 NativeAOT migration. This foundational change enables subsequent phases (JSON, CLI, ProjFS, framework retarget) to modify package references without conflicting on version numbers.

Enable ManagePackageVersionsCentrally and move all PackageVersion declarations
to Directory.Packages.props. Individual csproj files no longer specify Version
on PackageReference elements.

Pre-declare System.Text.Json, System.CommandLine, and
System.IO.Pipes.AccessControl for upcoming migration phases.

Assisted-by: Claude Opus 4.6
Signed-off-by: Tyrie Vella <tyvella@microsoft.com>
Copy link
Copy Markdown

@KeithIsSleeping KeithIsSleeping left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tyrielv tyrielv merged commit a35630d into microsoft:master Apr 9, 2026
45 checks passed
@mjcheetham mjcheetham mentioned this pull request May 11, 2026
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