I am trying to install Nuget packages via the cmd because our program runs on multiples VMs which chosen randomly. Some of these VMs have Nuget installed and have a NuGet.Config file which installs the packages in a folder my project cannot detect.
I created my own NuGet.Config and put in the root of my project folder, I tested it locally and everything works fine. I want something like "nuget.exe -configfile NuGet.Config" so that the packages will be installed in my project folder as I configured. Any help?
Yes. Based on the docs, the NuGet CLI accepts an option to indicate which config file to use. The syntax goes as follows:
nuget.exe restore -ConfigFile <a-path-to-the-config-file>
In your case:
nuget.exe restore -ConfigFile .\NuGet.Config
Based on the details on your question, the "restore" part was all that it was missing.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With