【问题标题】:How to update a .NET Core solution using the dotnet CLI on Azure Devops Pipeline?如何使用 Azure Devops Pipeline 上的 dotnet CLI 更新 .NET Core 解决方案?
【发布时间】:2021-09-19 03:13:28
【问题描述】:

我有一个名为 Boost.Core.sln 的解决方案,其中包含一个项目。我想使用 dotnet CLI 更新项目中的包。

我可以得到这样的包列表:

C:\Users\RedEase\Source\Repos\Boost.Core\Boost.Core>dotnet list Boost.Core.sln package
Project 'Boost.Core' has the following package references
   [net5.0]:
   Top-level Package            Requested   Resolved
   > Boost.Core.AspNetCore      0.0.1       0.0.1
   > Boost.Core.UI              0.0.2       0.0.2
   > Boost.Core.Utils           0.0.4       0.0.4
   

Boost.Core.AspNetCore 项目现在的版本为 0.0.10。我想将项目从 0.0.1 升级到 0.0.10,但它需要编写脚本,而且我不知道我事先要升级到的确切版本号。我想使用 dotnet 命令行工具而不是直接使用 nuget.exe。

我正在尝试从 Azure Devops Pipeline 执行此操作。

(如果需要,我愿意换个方向。)提前谢谢。

【问题讨论】:

    标签: .net-core azure-devops nuget azure-pipelines


    【解决方案1】:

    https://ardalis.com/how-do-i-update-a-nuget-package-using-dotnet-cli/ 表示 dotnet add package 命令已经这样做了:

    dotnet add package Boost.Core.AspNetCore project.csproj
    

    【讨论】:

    • 是的,它做到了。我正在尝试从 Azure Devops Pipeline 甚至从 Visual Studio 之外我自己的计算机上的命令行执行此操作。我已经意识到 dotnet CLI 是一个 Visual Studio 工具,所以不可能在管道上做我想做的事情。
    • 呃...dotnet 不是 VS 工具。它是一个独立的 CLI 应用程序。 Here are some examples of running any dotnet command in your azure devops pipeline
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2020-01-27
    • 1970-01-01
    • 2018-08-22
    • 1970-01-01
    • 2020-10-18
    • 2019-08-03
    • 2019-11-01
    相关资源
    最近更新 更多