VS2010 Update Nuget package to a specific version, but also update dll References in projects
For example my solution uses Nuget package "foo" with version "1.2.30". I want to Update "foo" package for all my solution projects to version "1.2.25", for example. I can't do it through Visual Studio Nuget addon, because if I right click on solution -> Manage packages -> Updates, Nuget won't propose me to update to the version that I want. Nuget will propose only the latest version.
So, I'm using workaround like this:
- Manually change "packages.config" files for all projects that use this package from "1.2.30" to "1.2.25" package version.
- Right click on solution and Restore packages (Nuget will download "foo" v1.2.25).
- After that I need to update References in all projects that use this package, because they still reference "1.2.30". So I open every project "References", Remove the "foo" dll reference(v1.2.30) and then click Add and add dll reference "foo"(v1.2.25).
- Nuget VS2010 addon is so awesome, why doesn't it have "update to specific version" option in Visual Studio 2010?
- Is there any other easier steps to do what I want ?
Thanks a lot, that's really bugging me.
You can use Package Manager Console(Tools -> Nuget Package Manager -> Package Manager Console) in Visual Studio to command Nuget what to do via console. It is much more flexible than "Manage Nuget packages".
Examples: Update package "foo" only for project "MyProject":
Update-Package -Id foo -Version 1.2.25 -ProjectName MyProject -IncludePrerelease
Update package "foo" for all projects in solution:
Update-Package -Id foo -Version 1.2.25 -IncludePrerelease
Full help can be found here:
You should be able to do this from the Package Manager Console. The following should update all NUnit NuGet packages to version 2.6.1 which is not the latest version.
Update-Package NUnit -version 2.6.1