Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What nuget version is used by dotnet CLI /when do nuget features make it into the dotnet CLI?

I have both a specific and a broader question, and I'll use the specific one to illustrate the broader:

My use case is that I want to use this feature Support pre release packages with floating versions, which will be available in Nuget 5.6, both for local development and in my CI/CD pipelines for my .NET Core applications

So basically I want to use this feature in combination with:

  1. the standalone nuget.exe CLI (for local dev)
  2. Visual Studio (for local dev)
  3. dotnet CLI's dotnet restore command (for local dev and for my pipelines)

For (1), it's pretty simple, when 5.6 is released, I can use it.

For (2), I found on here that each Nuget 5.x version was available in Visual Studio 16.x, so I guess theres's a good chance, that, when Visual Studio 16.6 is out, nuget 5.6 will be used there as well. (Couldn't find any other docs specifying this)

For (3), I have no idea.

So my specific question/problem was: When will I be able to use package reference versions like "*-*" that will use the latest release or prerelease version available and be able to run a dotnet restore command that understands this? As soon as nuget 5.6 comes out?

I found here that

The only difference: dotnet restore is a convenience wrapper to invoke dotnet msbuild /t:Restore which invokes an MSBuild-integrated restore. This only works on MSBuild distributions that include NuGet, such as Visual Studio 2017 (full Visual Studio, build tools) or Mono 5.2+ (=> msbuild /t:Restore) and the .NET Core SDK which provides this convenience command.

but again, which nuget version is used?

But my broader question coming from this is: What nuget version does the dotnet CLI use? Can you even say it uses a specific "version" or does it just contain a certain subset of features of nuget that do not really correspond to a version? Is there any documentation/process specifying when features of nuget make it into the dotnet CLI?

like image 532
dzebdf Avatar asked Mar 19 '20 12:03

dzebdf


People also ask

What version of NuGet is Visual Studio using?

How do I check the exact version of the NuGet tools that are installed? In Visual Studio, use the Help > About Microsoft Visual Studio command and look at the version displayed next to NuGet Package Manager.

Where can I find NuGet CLI?

Use nuget update -self on Windows to update an existing nuget.exe to the latest version. The latest recommended NuGet CLI is always available at https://dist.nuget.org/win-x86-commandline/latest/nuget.exe .

How use NuGet command line?

To use any command, open a command window or bash shell, then run nuget followed by the command and appropriate options, such as nuget help pack (to view help on the pack command). This documentation reflects the latest version of the NuGet CLI.


1 Answers

What nuget version does the dotnet CLI use? Can you even say it uses a specific "version" or does it just contain a certain subset of features of nuget that do not really correspond to a version?

Since Net Core 2.1, dotnet cli contains partial nuget.exe cli functionality subsets rather than full nuget.exe cli, such as package projects, push packages, delete packages, restore packages, and so on.

Each dotnet cli corresponds to a version of the nuget.exe cli.

In fact, every net core sdk version will integrate some of the functionality of the corresponding version of nuget.exe cli and then renamed it as its special nuget version.

For an example, Net Core 3.1 sdk integrate part of nuget exe 5.5.0 functions and then make its own dotnet nuget version called 5.5.0.4(you see it by call dotnet nuget --version in CMD) while the related nuget.exe cli version is 5.5.0.6382.

Ultimately, the functions between them are the same, but different version numbers are set to distinguish them.

Nuget.exe cli version:

enter image description here

dotnet nuget version

enter image description here

And Net Core 3.0 sdk integrates part of nuget.exe 5.3.1.6368 and create its own dotnet nuget version 5.3.0.1 as a result.

Actually, you can see the nuget targets file and the corresponding function DLLs in this section under this path: C:\Program Files\dotnet\sdk\3.1.200 and you can see these parts of nuget functions.

enter image description here

like image 194
Mr Qian Avatar answered Oct 17 '22 23:10

Mr Qian