Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a command to point nuget.exe to a specific NuGet.Config file?

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?

like image 648
Mark20 Avatar asked Oct 29 '25 10:10

Mark20


1 Answers

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.

like image 109
jcespinoza Avatar answered Oct 31 '25 00:10

jcespinoza