Download from best mirror

Aug 1, 2011 at 10:37 AM

I'm proposing using nuget in-house for managing dependent (C++ and .NET) packages in a globally distributed dev team (~200 devs).  I'd like to set up mirrored source repositories (e.g. using an overnight sync job), then have a way to find the 'closest' source for checking/installing packages, e.g. a ping to each server and see which responds quickest, or a manual selection of package servers by the user, this choice could also be cached locally.  Any thoughts on implementing this?

thanks, terry

Aug 1, 2011 at 4:21 PM

NuGet itself doesn’t support this inherently, but it should be fairly easy to setup.

Follow the instructions here to set up one or more NuGet.Server instances:

NuGet.Server uses the filesystem as the repository, so you just need to sync the ~/Packages directory.

As for determining the closest server, the best I can think of is use Network Load Balancing (NLB) with IIS and Windows Server 2008:

But that seems like it could be overkill. Once you’re replicating the NuGet.server, are you sure you’re going to have any more problems? Maybe just tell folks which repository to use manually and if they run into connection issues, you can set up NLB.

NuGet does allow folks to add multiple package sources, so you could tell people to add multiple of them and put the closest one up top in the list (since that’s the one we use first).

Aug 3, 2011 at 11:35 AM

Not to spam around: MyGet ( supports this out of the box ;-)

Aug 3, 2011 at 2:04 PM

that's good, can't see it documented so i assume that's a built-in feature.  our code is proprietary and our lawyers wouldn't allow it out of the building unfortunately.  is there any way to take advantage of that feature hosting within our firm?

Aug 3, 2011 at 5:35 PM
You could use the nuget copy extension and surround it with code that would perform the finding packages from one source to sync up between the two servers.