【问题标题】:Show outdated nuget packages with dotnet CLI使用 dotnet CLI 显示过时的 nuget 包
【发布时间】:2018-12-10 13:48:44
【问题描述】:

我正在使用 .NET Core、VS Code、Linux。

要更新一个包,我手动更改.csproj 中的版本,然后运行dotnet restore

但是如何使用dotnet CLI 判断哪些包已过时?

【问题讨论】:

    标签: .net-core nuget


    【解决方案1】:

    没有安装任何额外的工具,我使用了这个命令:

    dotnet list package --outdated 
    

    https://github.com/NuGet/Home/wiki/dotnet-list-package

    【讨论】:

      【解决方案2】:

      我不相信 vanilla .NET Core 中有任何东西,但我发现了一个名为 NuKeeper 的 .NET Core 全局工具,它可以满足您的需求:

      # Install the global tool
      $ dotnet tool install --global NuKeeper
      
      # Run the tool to inspect a project in the current directory for updated dependencies
      $ NuKeeper inspect
      

      它还可以为您执行更新 - 有关示例等,请参见上面的链接。

      (我在今天之前没有使用过这个,但我刚刚在一个示例项目中尝试过它,它给了我预期的信息。)

      【讨论】:

        【解决方案3】:

        您还可以使用dotnet outdated 全局工具。

        https://github.com/jerriep/dotnet-outdated

        dotnet tool install --global dotnet-outdated
        dotnet outdated
        

        【讨论】:

        猜你喜欢
        • 2020-06-30
        • 2022-10-13
        • 1970-01-01
        • 2021-09-15
        • 2017-04-26
        • 1970-01-01
        • 1970-01-01
        • 2017-07-01
        • 1970-01-01
        相关资源
        最近更新 更多