For the complete documentation index, see llms.txt. This page is also available as Markdown.

Directory.Packages.props Template

Purpose

Central package management keeps NuGet versions consistent across projects.

Template

<Project>
  <PropertyGroup>
    <ManagePackageVersionsCentrally>true</ManagePackageVersionsCentrally>
  </PropertyGroup>

  <ItemGroup>
    <PackageVersion Include="Microsoft.Extensions.Logging" Version="[approved-version]" />
    <PackageVersion Include="Microsoft.EntityFrameworkCore" Version="[approved-version]" />
    <PackageVersion Include="Microsoft.EntityFrameworkCore.SqlServer" Version="[approved-version]" />
    <PackageVersion Include="xunit" Version="[approved-version]" />
    <PackageVersion Include="Microsoft.NET.Test.Sdk" Version="[approved-version]" />
  </ItemGroup>
</Project>

Rules

  • Pin package versions centrally.

  • Do not allow random per-project package upgrades.

  • Review transitive dependencies.

  • Keep package updates small and testable.

  • Record major package upgrades in changelog or ADR where material.

Was this helpful?