Nuget batch file capability?

Our solution has 12 projects and anytime we get the latest TFS, build breaks and look for assemblies from nuget (given the correct version that worked) uninstalling / reinstalling / installing is very cumbersome.

I was wondering if there is an option to run a batch file in the Package Manager Console.

Below are the various commands that I am going to use.

  • Typically, I clean up all existing assemblies in the project, so I run the uninstall command on all different packages and for all projects. we have about 13-14 commands, as shown below (for example, I have few of them) UnInstall package Newtonsoft.Json; UnInstall Package Microsoft.AspNet.WebHost

  • I am running packages of individual packages projects.config which have the assemblies I need with the correct version

for ex:

nuget install [projectpath] \ packages.config

I need to execute the above command for all 12 projects.

Is there a way to combine both of these operations in a batch file so that I just run the batch file and all cleanup and installation are accepted?

I'm new to Package Manager Console, so I'm not sure if this is possible. I know it can be done using the Package Manager dialog, but I am looking at solutions that can be run from the command line

Thank you so much

+3


source to share





All Articles