NuGet Packages

I can never remember how to limit what versions of NuGet packages are allowed for a project. So here are how it’s done

Version ranges and wildcards

When referring to package dependencies, NuGet supports using interval notation for specifying version ranges, summarized as follows:

NotationApplied ruleDescription
1.0x ≥ 1.0Minimum version, inclusive
(1.0,)x > 1.0Minimum version, exclusive
[1.0]x == 1.0Exact version match
(,1.0]x ≤ 1.0Maximum version, inclusive
(,1.0)x < 1.0Maximum version, exclusive
[1.0,2.0]1.0 ≤ x ≤ 2.0Exact range, inclusive
(1.0,2.0)1.0 < x < 2.0Exact range, exclusive
[1.0,2.0)1.0 ≤ x < 2.0Mixed inclusive minimum and exclusive maximum version
(1.0)invalidinvalid