How to update packages using Nuget.exe

For my small examples of projects in .NET (built directly on the command line without using Visual Studio), I want to use Nuget.exe directly to get the libraries I need without fixing them in the source repository.

I managed to install them using the command

 nuget install packages.config -o $destinationFolder 

specifying the necessary packages in packages.config (for example, Nuget in Visual Studio). However, I cannot update installed packages. I tried to use this command

 nuget update packages.config -r $destinationFolder 

but Nuget.exe complains that

 unable to locate project file for '...packages.config'`. 

I searched on the Internet, but I only found a similar question on the Nuget discussion forums without answers.

+6
source share
1 answer

I read the corresponding source files in the Nuget project, and I found that to successfully complete the Nuget.exe update, Nuget.exe need to find the Visual C # / Basic / F # project.

Then I created an empty csproj in the folder, and I was able to update the packages that I installed earlier.

I made a small sample at https://github.com/edymtt/nugetstandalone that shows how to install and update packages using Nuget.exe . I also used a workaround to make sure that only the most recent library versions are stored in the folder.

Update 2013-04-06 14:20 UTC . I updated the sample to show how to achieve this using the -ExcludeVersion install flag.

+6
source

All Articles