From 770f5abb83f5b53c56a03b45c722f921fd050818 Mon Sep 17 00:00:00 2001 From: Eric StJohn Date: Wed, 13 Nov 2024 08:58:42 -0800 Subject: [PATCH] Add best practice to Package-Versioning.md --- docs/concepts/Package-Versioning.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/docs/concepts/Package-Versioning.md b/docs/concepts/Package-Versioning.md index 01a806a88..fcf216db9 100644 --- a/docs/concepts/Package-Versioning.md +++ b/docs/concepts/Package-Versioning.md @@ -116,9 +116,10 @@ When referring to package dependencies, NuGet supports using interval notation f | [1.0,2.0) | 1.0 ≤ x < 2.0 | Mixed inclusive minimum and exclusive maximum version | | (1.0) | invalid | invalid | -### Examples +### Best Practice Always specify a version or version range for package dependencies in project files, `packages.config` files, and `.nuspec` files. Without a version or version range, NuGet 2.8.x and earlier chooses the latest available package version when resolving a dependency, whereas NuGet 3.x and later chooses the lowest package version. Specifying a version or version range avoids this uncertainty. +Avoid specifying an upper bound to version ranges to packages you don't own unless you know of a compatibility problem. Upper bounds to version ranges harm adoption, discourage consumers from getting valuable updates to dependencies, and in some cases may lead them to use unsupported versions of dependencies. #### References in project files (PackageReference)