dotnet-check-updates
is a command-line tool for .NET that helps developers to check for possible upgrades of NuGet packages in their C# projects.
Inspired by npm-check-updates, this tool aims to streamline the process of keeping your .NET projects up-to-date with the latest package versions.
- Red = major version upgrade
- Cyan = minor version upgrade
- Green = patch version upgrade
To install dotnet-check-updates
, you can use the following command:
dotnet tool install --global dotnet-check-updates
- Support for C# projects (.csproj files) with PackageReferences
- Support for solutions (.sln files) for discovering projects
- Recursive search for project files with customizable depth
- Option to restore packages after an upgrade
- Listing of existing packages with their current versions
- Support for pre-release versions by specifying upgrade target
- Maintains existing version range notation, i.e.
Current | Upgraded |
---|---|
<PackageReference Include="semver" Version="2.0.6" /> |
<PackageReference Include="semver" Version="2.3.0" /> |
<PackageReference Include="semver" Version="[2.0.6,)" /> |
<PackageReference Include="semver" Version="[2.3.0,)" /> |
<PackageReference Include="semver" Version="[2.0.6]" /> |
<PackageReference Include="semver" Version="[2.3.0]" /> |
- Supports upgrading packages using PackageReferences in project and
Directory.Build.props
files - Supports upgrading packages using PackageVersion in
Directory.Packages.props
files - Only certain Version ranges are supported when checking for upgrades (pre-releases are supported for these ranges):
Notation | Description |
---|---|
1.0 |
Minimum version, inclusive |
[1.0,) |
Minimum version, inclusive |
[1.0] |
Exact version match |
By default, dotnet-check-updates will search the current directory for C# project (.csproj) files. If no project files are found, it will then search for solution (.sln) files in the current directory.
To use dotnet-check-updates, run the following command in your terminal:
dotnet-check-updates [OPTIONS]
NOTE: Alternatively when using the global tool you may also invoke:
dotnet check-updates [OPTIONS]
See Invoke a global tool for more information.
To list all available options run:
dotnet-check-updates --help
Check for the latest versions for all dependencies in discovered projects:
dotnet-check-updates
List existing packages and their versions while also searching for upgrades:
dotnet-check-updates --list
Include filters:
# Include only packages which contain the word system (case-insensitive) in their package name
dotnet-check-updates --filter 'System'
# or
dotnet-check-updates --filter '*System*'
# Include only packages which start with the word System
dotnet-check-updates --filter 'System*'
Exclude filters:
# Exclude packages which contain the word system (case-insensitive) in their package name
dotnet-check-updates --exclude 'System'
# or
dotnet-check-updates --exclude '*System*'
# Exclude packages which start with the word System
dotnet-check-updates --exclude 'System*'
Upgrade packages in the found projects to the latest version:
dotnet-check-updates --upgrade
Make sure your projects are in version control and all changes have been committed. This will overwrite your project files.
Search for projects in a specific solution file, upgrade packages and restore them:
dotnet-check-updates --solution path/to/your/solution.sln --upgrade --restore
Make sure your projects are in version control and all changes have been committed. This will overwrite your project files.
dotnet-check-updates is licensed under the MIT License