visual-studio - dotnet CLI 使用什么 nuget 版本/nuget 功能何时进入 dotnet CLI?

标签 visual-studio .net-core nuget

我有一个特定的和更广泛的问题,我将使用特定的问题来说明更广泛的问题:

我的用例是我想使用此功能 Support pre release packages with floating versions ,它将在 Nuget 5.6 中提供,既可用于本地开发,也可用于我的 .NET Core 应用程序的 CI/CD 管道

所以基本上我想结合使用这个功能:

  • 独立的 nuget.exe CLI(用于本地开发)
  • Visual Studio(用于本地开发)
  • dotnet CLI's 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 版本:

    enter image description here

    dotnet nuget 版本

    enter image description here

    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函数的这些部分。

    enter image description here

    关于visual-studio - dotnet CLI 使用什么 nuget 版本/nuget 功能何时进入 dotnet CLI?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60756934/

    相关文章:

    visual-studio - Visual Studio 2012 调试器在调试 Azure 项目时突然停止

    c# - 使用 EF Core 3.1 在 SQL Server 上生成不可为空的行版本

    c# - where 子句中未使用 EFCore 枚举到字符串值的转换

    c# - 更新后 System.Reflection 多个程序集错误

    powershell - nuget 对文件名中的空格进行编码

    nuget - vs Nuget 包管理器有替代方案吗?

    visual-studio - 乌龟SVN : new items not added to project

    visual-studio - 如何请求对 TFS 中的单个文件进行代码审查?

    visual-studio-2010 - Visual Studio 文本编辑器中的 "col"值是多少

    c# - Apache Ignite.NET 和 AppDomain.CurrentDomain.ProcessExit