Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MAC OSX Mono Nuget how to set up a default %AppData%\NuGet\NuGet.config

Tags:

macos

nuget

mono

I can exec something like -

mono --runtime=v4.0.30319 /Library/TeamCity/buildAgent/work/b0d2d3fefe88d393/.nuget/NuGet.exe' install '/Library/TeamCity/buildAgent/work/b0d2d3fefe88d393/something/packages.config' -source 'http://www.someurl.com/feed/' -RequireConsent -solutionDir '/Library/TeamCity/buildAgent/work/b0d2d3fefe88d393/'

to tell mono Nuget to look at a specific Nuget Source.

But assuming for some reason I could not modify the nuget command line call to add a -source parameter, how could I do this using a default config file as per (windows variant) -

http://docs.nuget.org/consume/command-line-reference#install-command

ConfigFile (v2.5) The NuGet configuation file. If not specified, file %AppData%\NuGet\NuGet.config is used as configuration file.

so, I can then set up "Package sources" from here -

https://docs.nuget.org/consume/nuget-config-settings

Can this approach work on the mac?

like image 674
WickedW Avatar asked May 06 '15 12:05

WickedW


1 Answers

Default location of NuGet config file on OS X is in user's home directory:

~/.config/NuGet/NuGet.Config 

You should be able to add <packageSources> setting to this file according to docs.

Create the file if it doesn't exist.

like image 157
baf Avatar answered Sep 26 '22 19:09

baf