Skip to content

Instantly share code, notes, and snippets.

@johnsimons
Created November 9, 2015 04:57
Show Gist options
  • Select an option

  • Save johnsimons/376f1709d31900f1bfed to your computer and use it in GitHub Desktop.

Select an option

Save johnsimons/376f1709d31900f1bfed to your computer and use it in GitHub Desktop.
Finding latest production version for a major release
var repo = PackageRepositoryFactory.Default.CreateRepository("https://www.nuget.org/api/v2/");
var pkg = repo.FindPackage(packageID,
new VersionSpec
{
MaxVersion = new SemanticVersion(4, 0, 0, 0),
IsMaxInclusive = false,
MinVersion = new SemanticVersion(3, 0, 0, 0),
IsMinInclusive = true
}, false, false);
Console.Out.WriteLine("version={0}", pkg.Version);
@johnsimons

Copy link
Copy Markdown
Author

Thanks @emgarten

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment