A dotnet tool that updates packages for all solutions in a directory.
See Milestones for release notes.
https://nuget.org/packages/PackageUpdate/
Ensure dotnet CLI is installed.
Install PackageUpdate
dotnet tool install -g PackageUpdate
packageupdate C:\Code\TargetDirectory
If no directory is passed the current directory will be used.
packageupdate C:\Code\TargetDirectory
packageupdate -t C:\Code\TargetDirectory
packageupdate --target-directory C:\Code\TargetDirectory
The package name to update. If not specified, all packages will be updated.
packageupdate -p packageName
packageupdate --package packageName
- Recursively scan the target directory for all directories containing a
.sln
file. - Perform a dotnet restore on the directory.
- Recursively scan the directory for
*.csproj
files. - Call dotnet list package to get the list of pending packages.
- Call dotnet add package with the package and version.
When processing multiple directories, it is sometimes desirable to "always ignore" certain directories. This can be done by adding a PackageUpdateIgnores
environment variable:
setx PackageUpdateIgnores "AspNetCore,EntityFrameworkCore"
The value is comma separated.
Use context-menu.reg to add PackageUpdate to the Windows Explorer context menu.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Directory\Shell]
@="none"
[HKEY_CLASSES_ROOT\Directory\shell\packageupdate]
"MUIVerb"="run packageupdate"
"Position"="bottom"
[HKEY_CLASSES_ROOT\Directory\Background\shell\packageupdate]
"MUIVerb"="run packageupdate"
"Position"="bottom"
[HKEY_CLASSES_ROOT\Directory\shell\packageupdate\command]
@="cmd.exe /c packageupdate \"%V\""
[HKEY_CLASSES_ROOT\Directory\Background\shell\packageupdate\command]
@="cmd.exe /c packageupdate \"%V\""
To use authenticated feed, add the packageSourceCredentials to the global nuget config:
<packageSourceCredentials>
<feedName>
<add key="Username" value="username" />
<add key="ClearTextPassword" value="api key" />
</feedName>
</packageSourceCredentials>
Update by Andy Miranda from The Noun Project.