Using additional NuGet Package Sources on a Build Server

Now we can see the new package source on our machines, and download all kinds of fun things from it. But how do we give other servers (e.g. a build server) knowledge of this new package source?

NuGet already thought of this (thank you kindly).  Check out the NuGet.targets file (once you’ve enabled Package Restore on the solution).  You’ll want to look for a <PackageSources> element.  It may be a little convoluted, and you’ll see a few Condition=” $(PackageSources) = ” thrown around (just ignore those).  What you are looking for is the element itself.

By default, if you do not specify any package sources, NuGet will use  The minute you specify a package source, NuGet will NOT use the default package source unless you explicity say to.

That just means you’ll need to add BOTH your new package source, and the NuGet default source (in a semi-colon separate list).  You will add these to the <PackageSources> element.

<!-- NuGet command -->
<!-- ... -->
<PackageSources ...>;\\MYSERVER\MySharedFolder

Now your can freely enable NuGet Package Restore and your build server can find your packages with ease!

Your Thoughts?

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s