All Collections
MyGet Help
NuGet
SemVer2 support for NuGet endpoints on MyGet
SemVer2 support for NuGet endpoints on MyGet
Toshi Dávila avatar
Written by Toshi Dávila
Updated over a week ago

MyGet has historically always encouraged and supported Semantic Versioning, and has support for NuGet's opinionated implementation of SemVer2.

SemVer2 package versions can be recognized by either one of the following properties (or any combination thereof):

  • a numeric identifier in release label of the package version or a dependency version

  • a metadata part in the package version

Older v2 NuGet clients do not support these, and official NuGet client support was added in v4.3.0.

To fully understand this design, you need some background information on NuGet's SemVer2 support.

In short, SemVer2 package versions are hidden by default on NuGet's v2 OData endpoints. 

MyGet adopts that spec, which is why you don't see those particular package versions using the default v2 endpoints.

The solution: use the latest nuget.exe client and target the NuGet V3 endpoint of your MyGet feeds.

Alternatively (consider this an FYI, as this is really just a big hack on V2 that the NuGet team decided to support), MyGet also supports the ?semVerLevel=2.0.0 query parameter on the V2 OData endpoints (which only the very latest nuget.exe clients are sending). You can find the latest nightlies on MyGet (where else :)): https://dotnet.myget.org/F/nuget-build/api/v2/package/NuGet.CommandLine

In other words, the latest NuGet client also supports SemVer2 packages on v2 endpoints by sending this query parameter (if the server supports it of course, which we already do at MyGet).

Did this answer your question?