0
votes

I have a NuGet package hosted on a Sonatype Nexus server and want a URL I can call to download the latest version of the package. I can get a particular version of the package by calling the following URL:

http://mynexus/content/repositories/nuget-releases/MyNuGetPackage/1.0.0.0/MyNuGetPackage-1.0.0.0.nupkg

How can I get the latest version of the package without knowing what the latest version number is?

1
My first thought is, how does the Package Manager console resolve the latest version when you use the cmdlet Install-Package? Perhaps you could use the PackageRepositoryFactory class in NuGet.Core to connect to your server and then use semver to determine the latest? blog.nuget.org/20130520/Play-with-packages.htmlDan Mork

1 Answers

0
votes

Answer from Sonatype Nexus support:

NuGet clients calculate the latest version based on downloaded package metadata. Nexus does not expose a single REST call to get the latest Nuget package. You would have to try and mimic what a nuget client does.