NugetVersion 1.6.1

dotnet tool install --global NugetVersion --version 1.6.1
This package contains a .NET tool you can call from the shell/command line.
dotnet new tool-manifest # if you are setting up this repo
dotnet tool install --local NugetVersion --version 1.6.1
This package contains a .NET tool you can call from the shell/command line.
#tool dotnet:?package=NugetVersion&version=1.6.1
nuke :add-package NugetVersion --version 1.6.1

NugetVersion .NET Core Global tool

.NET Core Global Tool for querying and updating Nuget project versions across multiple projects within a directory

Global tool for .NET 6.x+ and later

.NET 6.x+ is required for global tools, meaning that you can install nugetversion using the .NET CLI and use it everywhere.

⚠️ To use global tools, .Net Core SDK 2.1.300 or later is required.

Install nugetversion as a global tool first time

dotnet tool install -g nugetversion [--version version]

Update nugetversion to the latest, or specified

dotnet tool update -g nugetversion

Uninstall

dotnet tool uninstall nugetversion

Query

From this point on, you can run the following to query all projects for nuget package references, with optional name and version filtering

nugetversion src-dir-to-project-folders [-n|--name nameSpec] [-v|--version versionSpec] [-o filepath] [-of json] [-fw targetFramework]
  • nameSpec can be a wildcard search like *something*
  • versionSpec can be a wildcard search, eg 1.*.0

Arguments

  • -n nameSpec - nuget name filter with wildcards ie -n Microsoft.*
  • -v versionSpec - version filter ie -v 1.0.*
  • -o filepath - output results to file -o somefile.txt, now with -of flag this would suit -of somefile.json
  • -of output-format - format to output, ie -of json to output json, combine with -o flag to write file
  • -fw targetFramework - filter by target framework, ie -fw net5.0
  • -sv|--set-version - to set new version for queried packages, can use -sv latest to set to latest available version
  • -supver|--suppress-version-checks - suppress remote version checks. Can speed up results, but will not load latest versions.

Update Versions

To update versions for a specific query, specify the --set-version <VERSION>|latest switch, this uses the internal .NET core package command so is generally safe to use, however just be aware it will update according to the query you specify.

This will show a list of items to be updated, and will prompt before starting the update process.

nugetversion src-dir-to-project-folders [-n|--name nameSpec] [-v|--version versionSpec] --set-version x.x.x

WARNING: this will update ALL project file(s) and projects that match that criteria to the specific version specified if that version is available for that package.

Examples:

Set to latest available

nugetversion mypath-to-src -n Microsoft.Extensions* -sv latest

Set to specific version

nugetversion mypath-to-src -n Microsoft.Extensions* -sv 6.0.0

Release History

1.6.0

  • fix: multiple target frameworks crash
  • added: getting latest nuget package version. can be suppressed with -supver
  • added: setting versions to latest using -sv latest

1.5.0

  • upgraded .net versions to .net6.0 LTS
  • added --suppressrefs option to exclude project references

1.0.6

  • Added output to file flag -o [filepath]
  • Added output format flag -of [json] - currently just json to render as json
  • Added framework filter -fw [targetframework] - ie net5.0
  • Added project references
  • Some code cleanups
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
Compatible target framework(s)
Additional computed target framework(s)
Learn more about Target Frameworks and .NET Standard.

This package has no dependencies.

Version Downloads Last updated
1.6.1 1,097 8/27/2023
1.0.12 1,406 1/4/2023
1.0.11 1,263 1/4/2023
1.0.10 1,071 1/4/2023
1.0.6 1,422 1/21/2022
1.0.5 1,364 5/22/2021
1.0.4 1,016 6/20/2018
1.0.3 909 6/20/2018
1.0.0 983 6/20/2018