【发布时间】:2018-12-10 13:48:44
【问题描述】:
我正在使用 .NET Core、VS Code、Linux。
要更新一个包,我手动更改.csproj 中的版本,然后运行dotnet restore。
但是如何使用dotnet CLI 判断哪些包已过时?
【问题讨论】:
我正在使用 .NET Core、VS Code、Linux。
要更新一个包,我手动更改.csproj 中的版本,然后运行dotnet restore。
但是如何使用dotnet CLI 判断哪些包已过时?
【问题讨论】:
没有安装任何额外的工具,我使用了这个命令:
dotnet list package --outdated
【讨论】:
我不相信 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
它还可以为您执行更新 - 有关示例等,请参见上面的链接。
(我在今天之前没有使用过这个,但我刚刚在一个示例项目中尝试过它,它给了我预期的信息。)
【讨论】:
您还可以使用dotnet outdated 全局工具。
https://github.com/jerriep/dotnet-outdated
dotnet tool install --global dotnet-outdated
dotnet outdated
【讨论】:
dotnet tool install --global dotnet-outdated-tool来安装。