-
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) - dotnet update package #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 |
@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. |
Whenever i download a complex solution to a clean machine, my build script based on "msbuild" always fails because one or more nuget package are not updated automatically. So here i am. Any viable commandline solution to do this automatically ? |
If you don't have the typical utils from Git Bash/MinGW at your disposal in that env, you could try and find an incantation with findstr or a powershell alternative and then use a method like the one employed in this SO post (option 2) to call the update command with each individual package name. Pure CMD would be some loop incantation instead |
@eng-marani Why do you need to update NuGet packages for your build to succeed after downloading it? This goes completely against the principle of Reproducible builds. Downloading a solution from source control and building it with using the versions of the NuGet packages that were intended to be used by the developers of the project should just work... Seems like you might have other issues The ask/tool being proposed here is to be explicit about updating packages, where you'd run a command line to update the packages to the new version, then commit these changes to source control, have your CI build pass, etc. |
That was until nuget 6.12 :) |
@eng-marani I'm not sure I understand your use case but I made https://github.com/OskarKlintrot/UpdatR to update our solutions at work, maybe that can help you out? |
@OskarKlintrot Is there a big breaking change in NuGet 6.12? The Release Notes doesn't seem to call out anything major 🤔 |
@augustoproiete We have Warnings As Errors turned on and 6.12 started to warn about vuln in transitive dependencies instead of only direct dependencies. |
the only change i am aware of was included in net9 https://learn.microsoft.com/en-us/dotnet/core/whats-new/dotnet-9/overview#net-sdk
|
@SimonCropp We are just splitting hair now but nuget 6.12 is bundled with .NET 9.0.1 (or something like that) and both came with VS 2022 17.12. We (my org) got new computers so naturally we installed VS and cloned our repos and then nothing would build (iirc a transitive dep to EF Core 8). Check point 2 here: https://learn.microsoft.com/en-us/nuget/release-notes/nuget-6.12#summary-whats-new-in-612 Edit: Sorry for going completely ot, I'll stop now. Edit2: I hope I don't come across as too but hurt, I do think the feature is brilliant! |
"Reproducible Builds" sounds wonderful, if it would eventually work. |
@eng-marani so you need to interactively build the first time on your CI machines? |
Yes, without doing this i get a lot of errors. Once nuget are updated inside visual studio at least one time, i can build again from a batch file using msbuild just fine. I wonder if something exists that make me able of avoiding this stage. This is particularly frustrating because, when i switch checkout branch, it may happens that nuget packages should have a different version, thus i need to manually build any time i checkout a different branch of the same product. Very annoying. |
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: