Distributing Package Manager (NuGet) Settings

Mar 9, 2012 at 9:23 PM


I was wondering if there was a way to distribute the Visual Studio Package Manager settings?  I would like to host an internal NuGet server and want an easy way for the rest of the developers in my organization to configure their Package Manager so everyone doesn't have to manually add it.

I looked in to using the built-in "Import/Export Settings..." option but these settings are not amoung the ones available for import/export - guessing because these are settings for an extension rather than out-of-the-box functionality.



Mar 12, 2012 at 8:41 PM

There is not a way to share the settings.

Mar 13, 2012 at 12:06 AM

We use something like this (primitive, but it works).  Run in as a deployment script, login script or one time.


@echo off
echo Setting sources....

rem Set a local....
call :setsource "Local Packages" d:\LocalPackages

rem All the rest....
call :setsource Source1 http://source1/api/feeds
call :setsource Source2 http://source2/api/feeds
call :setsource Source3 http://source3/api/feeds
call :setsource Source4 http://source4/api/feeds
call :setsource Source5 http://source5/api/feeds

rem The default
call :setsource "NuGet official package source" "https://go.microsoft.com/fwlink/?LinkID=206669"

goto :eof

c:\nuget\nuget.exe sources remove -name %1 >nul
c:\nuget\nuget.exe sources add -name %1 -source %2 > nul
goto :eof