Skip to content

Commit 2f46761

Browse files
authored
Clarify SemVer 2.0.0 prerelease sort order (#2538)
Note: EF Package name is not really a best practice for SemVer, so the documentation is a bit confusing.
1 parent b7d577d commit 2f46761

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

docs/concepts/Package-Versioning.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ A specific version number is in the form *Major.Minor.Patch[-Suffix]*, where the
3535
1.0.1
3636
6.11.1231
3737
4.3.1-rc
38-
2.2.44-beta1
38+
2.2.44-beta.1
3939
```
4040

4141
> [!Important]
@@ -52,21 +52,24 @@ That said, package developers generally follow recognized naming conventions:
5252
- `-rc`: Release candidate, typically a release that's potentially final (stable) unless significant bugs emerge.
5353

5454
> [!Note]
55-
> NuGet 4.3.0+ supports [SemVer 2.0.0](https://semver.org/spec/v2.0.0.html), which supports pre-release numbers with dot notation, as in *1.0.1-build.23*. Dot notation is not supported with NuGet versions before 4.3.0. You can use a form like *1.0.1-build23*.
55+
> NuGet 4.3.0+ supports [SemVer 2.0.0](https://semver.org/spec/v2.0.0.html), which supports pre-release numbers with dot notation, as in *1.0.1-build.23*. Dot notation is not supported with NuGet versions before 4.3.0. You can use a form like *1.0.1-build23*. It is recommended to use NuGet 4.3.0+, because nuget.org and newer NuGet clients will not treat "1.0.1-build23" as greater than "1.0.1-build3".
5656
57-
When resolving package references and multiple package versions differ only by suffix, NuGet chooses a version without a suffix first, then applies precedence to pre-release versions in reverse alphabetical order. For example, the following versions would be chosen in the exact order shown:
57+
When resolving package references and multiple package versions differ only by suffix, NuGet chooses a version without a suffix first, then applies precedence to pre-release versions in reverse alphabetical order and treats dot notation numbers with numerical order. For example, the following versions would be chosen in the exact order shown:
5858

5959
```
6060
1.0.1
6161
1.0.1-zzz
62-
1.0.1-rc
62+
1.0.1-rc.10
63+
1.0.1-rc.2
6364
1.0.1-open
6465
1.0.1-beta
6566
1.0.1-alpha2
66-
1.0.1-alpha
67+
1.0.1-alpha10
6768
1.0.1-aaa
6869
```
6970

71+
Note that, 1.0.1-alpha10 is sorted strictly in reverse alphabetical order, whereas 1.0.1-rc.10 is greater precedence than 1.0.1-rc.2.
72+
7073
## Semantic Versioning 2.0.0
7174

7275
With NuGet 4.3.0+ and Visual Studio 2017 version 15.3+, NuGet supports [Semantic Versioning 2.0.0](https://semver.org/spec/v2.0.0.html).

0 commit comments

Comments
 (0)