skipnothing/.NET Platform

Assemblies & NuGet

Type `Version="8.0.0"` into a project file and it reads as an exact order. It isn't: that number is a floor, and a solver walks every dependency you never typed to pick the versions that actually ship.

  • What you write in Version= is the lowest you'll accept, not the one that ships; a solver chooses.
  • The file that actually decides your build sits in obj/, unlisted in your .csproj and uncommitted to your repo.
  • One .nupkg can ship several .dlls at once, and the box's version need not match the version stamped inside.
BUILDS ON
01

Version Is a Floor, Not a Pin

<PackageReference Include="System.Text.Json" Version="8.0.0" /> looks like an order for one specific build. Read literally, it states a minimum: x >= 8.0.0. NuGet's version notation is a grammar of intervals, not points. A bare 8.0.0 means at-or-above. Brackets, [8.0.0], are the only form that pins one exact build and rejects everything else. A trailing star, 8.0.*, does the opposite and tracks upward. So the same line you read as "give me 8.0.0" actually says "give me the smallest build you have that is at least 8.0.0", and which build that is depends on what the feed offers, not on what you typed.

ONE VERSION STRING, THREE DIFFERENT REQUESTS

Keep going, sign up to unlock the rest

4 more parts in this topic, plus 25+ more topics in .NET Platform.

Sign up, it's freeSee the full .NET Platform
The .NET Runtime0/5#4 Native AOT
#6 Stack vs Heap