-
Notifications
You must be signed in to change notification settings - Fork 253
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support for bulk-updating references into csproj from commandline(s) #4103
Comments
since add will support "update", we'll prioritize this task as the lowest of the 4:
|
Would it make sense to allow updating all package references? For a lot of dependencies, it is very quick to do sth like |
I would highly suggest checking out how yarn has taken care of this with https://yarnpkg.com/lang/en/docs/cli/upgrade/ https://yarnpkg.com/lang/en/docs/cli/upgrade-interactive/ I would just use the same names as well... |
Notice that #6193 added the additional requests to support cross-project updates, etc... |
Since this issue is 2 years old - are there any plans to create any basic cli commands for managing package versions? |
As part of continuous integration I'd like to auto-update dependencies to check that nothing breaks with newer versions. However, this seems impossible without this feature if you manage your dependencies in |
@letmaik you can always run |
@JonDouglas any progress? Seems #5208 this issue also related to this.
|
What is going on with this? |
Hi @JonDouglas, Any updates on this topic? |
Sorry, this has not been on my near-term list. I am hopeful to return to this next year. I apologize for not providing an update sooner as I was off on paternity leave and now focusing on some other large features. When this has our attention again, I will post a full spec on https://github.com/NuGet/Home/pulls & ask for everyone here to provide feedback. I will also incorporate the various comments since my last post when working on that artifact. Thanks all! |
here is my hacked approach https://github.com/SimonCropp/PackageUpdate |
And here's my approach: https://github.com/OskarKlintrot/UpdatR. I tried to make it's output pr- and ci/cd-friendly, similar to nukeeper. |
I would love to see this feature finally making into dotnet. |
Me too, I really hope they also make it stick to supported versions only! That is very useful to have! |
If it helps anyone, I just wrote a bash script to update everything to the latest stable. It searches the current directory for all C# projects and updates all outdated packages. I'm sure it could be improved but it works. for PROJECT in $(find . -iname '*.csproj')
do
for PACKAGE in $(dotnet list $PROJECT package --outdated | grep '>' | sed -r 's/^ *> ([a-zA-Z0-9\.]*) .*$/\1/gm')
do
dotnet add $PROJECT package $PACKAGE
done
done
echo Update Complete Here is a vscode task that can be added as a user level task. {
"label": "Update Nuget Dependencies",
"type": "shell",
"command": "for PROJECT in $(find . -iname '*.csproj'); do for PACKAGE in $(dotnet list $PROJECT package --outdated | grep '>' | sed -r 's/^ *> ([a-zA-Z0-9\\.]*) .*$/\\1/gm'); do dotnet add $PROJECT package $PACKAGE; done; done; echo Update Complete",
"presentation": {
"echo": true,
"reveal": "always",
"focus": false,
"panel": "shared",
"showReuseMessage": true,
"clear": false
},
"problemMatcher": []
} |
Hi friends, I have published a draft proposal for this feature. Please feel free to comment and provide your feedback on it. I tried my best to incorporate all the feedback here while also comparing to other ecosystems and existing feedback we've heard over the last year or so. |
@brendanlong @AlirezaHaghshenas you can even chop out a Might just toss a utility script somewhere on my path to combine this with @divinebovine's outer loop logic |
|
So about 8 years later, there's still no dotnet update command? |
hahâ |
@MMeshkiny Just for the benefit of anyone else looking for solutions, could you specify which environment/shell this is for? @RivenSkaye 's command worked in fish shell, but this one didn't. |
Both should work in any env providing the GNU utilities (there is also a GNU awk), though both just use pretty standard POSIX-y tooling. Try and see if your package manager provides an awk package |
While we wait for official support there's a pretty functional dotnet tool https://github.com/dotnet-outdated/dotnet-outdated |
I'm a bit partial to the famed Edit: it should work on all *proj files, not only .csproj, unless https://twitter.com/DotNetIsCSharp has taken over. |
|
Utterly embarrassing that we still have to beg for a simple update command in 2024. |
splitting off from #3751 - which now just covers the add side of this work
Spec draft: https://github.com/NuGet/Home/wiki/Support-dotnet-ref-add%7Cupdate%7Cdelete-packageref
nuget.exe update for package reference
The text was updated successfully, but these errors were encountered: