We have a scenario, where different teams work on different parts of a larger product. From time to time, all Visual Studio Projects of all Solutions there need to get some of their referenced NuGet packages updated. As a result of that update, all projects in the whole source tree should reference the same versions of the packages.
Is there a way to update a specific NuGet package to a specific version in all projects using some automatic approach like PowerShell scripts?
Edit: Is there a way to somehow load the necessary parts of Visual Studio and NuGet to also update the assembly references correctly?
Example:
NuGetScript Update Solution.sln PackageName -version NewVersion
or
NuGetScript Update PathToProjects PackageName -version NewVersion
There are too many components to load all of them in Visual Studio and update them manually via package manager UI.
Right-click the Packages folder in the project, and select Update. This will update the NuGet package to the latest version. You can double-click the Add packages and choose the specific version.
Please use following command line in Package Manager Console window to update a specific package in one solution.
Get-Project -All | Update-Package PackageName -Version newVersion
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With