asp.net-mvcmsbuildcontinuous-integrationcruisecontrol.netnuget

How to use NuGet packages on build server/production server without internet?


Background

I have the following components:

Goal

I would like to utilize NuGet packages from my solution and have them be stored locally as part of source -- without having to rely on an internet connection or nuget package server on my build and production servers.

Question


Solution

  • Scott Hanselman has written an excellent article entitled How to access NuGet when NuGet.org is down (or you're on a plane). If you read through this article, you'll see at the end that the suggestions he makes are primarily temporary-type solutions and he goes out of his way to say that you should never need the offline cache except in those emergency situations.

    If you read at the bottom of his article, however, he makes this suggestion:

    If you're concerned about external dependencies on a company-wide scale, you might want to have a network share (perhaps on a shared builder server) within your organization that contains the NuGet packages that you rely on. This is a useful thing if you are in a low-bandwidth situation as an organization.

    This is what I ended up doing in a similar situation. We have a share which we keep with the latest versions of various packages that we rely on (of course, I'm assuming you're on some type of network). It works great and requires just a little work to update the packages on a semi-regular basis (we have a quarterly update cycle).

    Another article that may also be of help to you (was to me) is: Using NuGet to Distribute Our Company Internal DLLs