简体   繁体   中英

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?

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.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM