JamesEggers
JamesEggers

Reputation: 12935

Installing Nuget packages from a config file

I'm used to gems, pip, and npm in the fact that I can provide some form of config file and the package management utility will install the items in that config for me.

I'm trying to find this feature in nuget for .Net but coming up short. I saw a command line utility that will download the packages of the config; however, I'd still have to manually add the references at that point (and it wouldn't take advantage of any script tasks that the package does to add additional files and what not).

So is there a way to use nuget that'll download packages from a custom package.config file, add the references to the project, and change/add any files that are associated with the packages?

Upvotes: 0

Views: 1351

Answers (2)

davidfowl
davidfowl

Reputation: 38764

No there's no way to do what you want. We never modify the project files outside of the IDE itself.

Upvotes: 0

David Savage
David Savage

Reputation: 769

Yes. By default Nuget puts the package files in a folder called ./packages. If you right-click your solution in Visual Studio and select "Enable Package Restore" it will add a config, exe, and targets file for your projects.

This will enable the project to download any files missing at compile time.

Upvotes: 4

Related Questions