Setting depndencies on public Nuget packages from internal Nuget server

Mar 5, 2012 at 4:37 PM

Hi guys,

We are planning to set up our own internal Nuget server. We want to restrict access to the public Nuget packages and instead make some the approved public Nuget packages  available through our own internal Nuget serever. How do we go a bout doing this?

I was thinking of creating an empty internal Nuget package that simply includes some public Nuget packages as "dependent". But it seems the dependant package must reside on the same Nuget server and can't go out to a different server. At least this is what I understand from looking at the Nuget spec file and the fact you can not specify a server for the dependant packages.  

Any help/advice is greatly appreciated. Thanks!

Developer
Mar 6, 2012 at 6:51 AM

When you install a package:-

1) We find the package you ask to install in the current source

2) For each dependency, we look for it first in the current source. If we don't find it, we look for it in all available sources (in no particular order). The first source that has the dependency wins.

In your case, as long as you have the official feed listed and enabled, installing packages from your local repository should get you dependencies from the official source.

Mar 6, 2012 at 1:44 PM

Thanks very much!!

It worked as you described. Thanks again.

Developer
Mar 8, 2012 at 4:11 PM

Another option would be to use package source proxying like MyGet does (see http://blog.maartenballiauw.be/post/2012/03/01/Introducing-MyGet-package-source-proxy-(beta).aspx). Inedo has a similar concept in ProGet (http://inedo.com/proget/overview)