Finding outdated dependencies with the .NET Core CLI and dotnet-outdated
Recently I’ve started using less of Visual Studio and relying more on VSCode and the .NET Core CLI. One thing that astounded me was that there’s no equivalent of something like the npm outdated
command, that shows which of your dependencies have a newer version available.
A bit of googling around brought me to the dotnet-outdated project on Github, which promises to provide just that functionality. Sadly it only supported the old project.json
format and not the new .csproj + <PackageReference />
format. An hour and one pull request later, .csproj
support is now built-in!
Installing and running
dotnet-outdated
is a .NET CLI tool and is added to the project’s .csproj
file like this:
<DotNetCliToolReference Include="dotnet-outdated" Version="2.0.0" />
Invoke dotnet restore
in the directory of the project to to restore the new tool into the project and then run dotnet outdated
to find all outdated packages. This is a sample output from the tool, taken from the Github project site:
Great! It’s now super easy to figure out what dependencies in a project have an update available.