0

The command dotnet add package PACKAGE does not install the latest version of a package. Isn't it supposed to check for the latest version when we are not giving a -v flag?

Also, when I run the command, the CLI is installing the oldest version of the package. It's important for me to dynamically get the latest version as I'm running an automation job which will install the latest package in repo2 when repo1 is done adding a new version of the package to GitHub packages.

  • Please include the steps necessary to reproduce this behavior - e.g. what version of the dotnet CLI you used, what frameowrk your project ragets (e.g. .NET 5,6,..) and which parckage you tried to reference. Was it a prerelease package (with a prerelease suffix) or a release packge version (3 or 4 number parts without prerelease identifier)? – Martin Ullrich Nov 03 '22 at 12:34
  • @MartinUllrich Hi, maybe I was not specific enough but here are the req's Target - > .NET 461 Referenced package - private package from private github nuget package registry .NET version - dotnet-version: '6.0.x' --prerelease - false – Ashwin Nambiar Nov 03 '22 at 12:39
  • @MartinUllrich I can also find that this is the first few entries in the index.json ```{ "count":1, "items":[ { "@id":"https://nuget.pkg.github.com/ORGANISATION/PACKAGE/index.json", "lower":"0.9.0-20200922-085546", "upper":"0.9.0", "count":274, "items":[ ... ]``` Isn't "upper" the one that dotnet refers when we do the dotnet add command? In my case the 'upper' is the oldest version of the package – Ashwin Nambiar Nov 03 '22 at 12:41

0 Answers0