How do I update nuget packages if the version is missing?

Running a situation where I deployed an application for production a few months ago and now I need to do a little bit of work on it on a brand new machine. The first thing I do is pull source and the nuget restore won't restore because it can't find the specific version of the package it was developed in. When I check nuget.org for this version of the package it is not there. So how do I update my solution to the latest binaries?

Visual Studio 2013 is trying to update ServiceStack "4.0.39" to the latest version, which is "4.0.40" at the time of publication.

Thanks Stephen

+3


source to share


3 answers


The best solution for this is to manually edit the Packages.config files and set the version number at any time you like. Then recovery should work. It's not a perfect solution, but it dug me out of some holes.



+3


source


(I know this is an old answer, but it just showed up in some kind of Googling)

One problem with the accepted answer (just updating the version # in packages.config) is that this will just trigger a "package restore" - and will skip any "install steps" the packages might have (things that were done automatically the first time they were added package, such as adding assembly references, modifying configuration files, etc.).



An alternative way would be to edit the packages.config file and DELETE the package in question, then start VS and add the new version. This will invoke the normal package installation procedure to do this.

+1


source


I recommend you use the NuGet Package Manager Console for Visual Studio:
TOOLS> NuGet Package Manager> Package Manager Console

Command to update a NuGet package to the latest version:
Update-Package ServiceStack

Command to update a NuGet package to a specific version:
Update-Package ServiceStack -version 4.0.40

-1


source







All Articles