我有一个特定的和更广泛的问题,我将使用特定的问题来说明更广泛的问题:
我的用例是我想使用此功能 Support pre release packages with floating versions ,它将在 Nuget 5.6 中提供,既可用于本地开发,也可用于我的 .NET Core 应用程序的 CI/CD 管道
所以基本上我想结合使用这个功能:
dotnet restore command
(对于本地开发人员和我的管道)对于(1),很简单,等5.6发布了就可以用了。
对于 (2),我在 here 上找到了每个 Nuget 5.x 版本都在 Visual Studio 16.x 中可用,所以我想很有可能,当 Visual Studio 16.6 发布时,nuget 5.6 也将在那里使用。 (找不到任何其他指定此内容的文档)
对于(3),我不知道。
所以我的具体问题/问题是:我什么时候才能使用像“*-*”这样的包引用版本 will使用可用的最新发行版或预发行版并能够运行
dotnet restore
明白这一点的命令? nuget 5.6 一出?我找到了 here那
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.
但同样,使用哪个 nuget 版本?
但我由此产生的更广泛的问题是:dotnet CLI 使用什么 nuget 版本?您甚至可以说它使用特定的“版本”,还是仅包含与某个版本并不真正对应的 nuget 功能的某个子集?
是否有任何文档/流程指定 nuget 的功能何时进入 dotnet CLI?
最佳答案
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?
自
Net Core 2.1
, dotnet cli 包含部分 nuget.exe cli
功能子集而不是完整 nuget.exe cli
,如打包项目、推送包、删除包、恢复包等。每个
dotnet cli
对应于nuget.exe cli
的一个版本.事实上 ,每个net core sdk版本都会集成
nuget.exe cli
对应版本的部分功能然后将其重命名为它的特殊 nuget 版本。例如 ,
Net Core 3.1
sdk 集成部分 nuget exe 5.5.0函数,然后制作自己的 dotnet nuget 版本,名为 5.5.0.4
(您可以在 CMD 中通过调用 dotnet nuget --version
看到它)而相关的 nuget.exe cli
版本是 5.5.0.6382
.最终 ,它们之间的功能是一样的,只是设置了不同的版本号来区分。
Nuget.exe cli 版本:
dotnet nuget 版本
和
Net Core 3.0
sdk 集成了 nuget.exe 5.3.1.6368
的一部分并创建自己的 dotnet nuget 版本 5.3.0.1
其结果。其实 ,你可以在这个路径下看到nuget目标文件和本节对应的函数DLL:
C:\Program Files\dotnet\sdk\3.1.200
你可以看到nuget函数的这些部分。关于visual-studio - dotnet CLI 使用什么 nuget 版本/nuget 功能何时进入 dotnet CLI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60756934/