Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show outdated nuget packages with dotnet CLI

I'm using .NET Core, VS Code, Linux.

To update a package, I manually change the version in the .csproj and then run dotnet restore.

But how can I tell which packages are outdated using the dotnet CLI?

like image 406
lonix Avatar asked Sep 03 '18 10:09

lonix


People also ask

How do I use outdated dotnet?

dotnet-outdated can automatically attempt to upgrade any outdated packages to the latest version by passing the -u|--upgrade option. You can let dotnet-outdated prompt you for each outdated package by using the -u:prompt option.

Where are .NET core NuGet packages stored?

The location of the default global packages folder. The default is %userprofile%\.nuget\packages (Windows) or ~/.nuget/packages (Mac/Linux).

How do I find NuGet version?

In Visual Studio, use the Help > About Microsoft Visual Studio command and look at the version displayed next to NuGet Package Manager. Alternatively, launch the Package Manager Console (Tools > NuGet Package Manager > Package Manager Console) and enter $host to see information about NuGet including the version.


2 Answers

Without installing any additional tool, I used this command:

dotnet list package --outdated 

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

like image 94
Stephen Pham Avatar answered Oct 08 '22 04:10

Stephen Pham


I don't believe there's anything within vanilla .NET Core, but I've found a .NET Core global tool called NuKeeper which will do what you want:

# 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

It can also perform the updates for you - see the link above for examples etc.

(I haven't used this before today, but I've just tried it on a sample project and it gave me the information I expected.)

like image 45
Jon Skeet Avatar answered Oct 08 '22 04:10

Jon Skeet