My understanding is that the nuget CLI and visual studio itself work not only with the offical nuget.org feed but with other feeds from third party sites like myget.
Does this mean that the feeds themselves follow a defined standard, so the tools can work with any feeds?
If so where can I find this standard?
I am also confused about the difference between the v2
and v3
nuget.org feeds.
Update
I now understand that there are two versions of the official nuget feeds, v2
which is OData based and v3
which is a rest api. I also understand that the nuget cli and visual studio are able to talk to both.
What I still don't understand is that if you look at this post https://docs.nuget.org/create/hosting-your-own-nuget-feeds, it states
There are several third-party NuGet Servers available that make remote private feeds easy to configure and set-up, including Visual Studio Team Services, MyGet, Inedo's ProGet, JFrog's Artifactory, NuGet Server, and Sonatype's Nexus. See An Overview of the NuGet Ecosystem to learn more about these options.
For both the nuget cli and visual studio to be able to work with all these various thirdparty feeds, surely there must be some underlying common standard feed format. Are they all use the same OData format as v2
for instance? This is the crux of my question.
Local NuGet package feeds are simply hierarchical folder structures on your local network (or even just your own computer) in which you place packages. These feeds can then be used as package sources with all other NuGet operations using the CLI, the Package Manager UI, and the Package Manager Console.
NuGet 4.3. 0+ supports SemVer 2.0. 0, which supports pre-release numbers with dot notation, as in 1.0.
Put simply, a NuGet package is a single ZIP file with the . nupkg extension that contains compiled code (DLLs), other files related to that code, and a descriptive manifest that includes information like the package's version number.
NuGet v2 provides an OData feed.
NuGet v3 provides a restful API uses a few different protocols, one of which I believe is based on JSON-LD.
There is some information in the Building NuGet 3.x post about this.
There is also some more information about the NuGet v3 API in another StackOverflow post
What NuGet API third party servers support is up to the third party server. VSTS for example supports both NuGet v2 and NuGet v3 APIs each of which have a different url. Team City for example implements the NuGet v1 API. ProGet at the time of writing supports NuGet v2.
The NuGet client itself hides these differences from you unless you use some of the lower level classes. The NuGet client itself has a simple check that if the url ends with index.json
then it is a NuGet v3 feed and uses a different set of classes to connect to the server. Otherwise it uses a NuGet v2 set of classes to connect to the server.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With