We have a private NuGet server and my issue is the TFS 2017 builds don't recognize the internal package's NuGet server, obviously, without specifying the URL. I've tried putting it in Nuget.config and it worked, but with some issues.
What I would like to do, however, is somehow add this to the global list of feeds. I do not have NuGet installed on the server, though NuGet restore is happening as a build Task, so it exists under c:_work_tasks\NuGetInstaller_333b11bd-d341-40d9-afcf-b32d5ce6f23b\0.2.21\ etc, and do not see anything that would let me change the set of feeds.
BTW, when I added a package source to nuget.config, it seemed to ONLY download from that source and ignored all the defaults, such as nuget.org, etc.
How can I add an internal nuget server so that all my builds natively can access it? Thanks.
Generally you just need to add the feeds (also add the nuget.org
source) to NuGet.config
file, then check in the file.
(If you used the third private NuGet server, then you can have a try with the Package Management in VSTS and TFS)
e.g.
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<!-- remove any machine-wide sources with <clear/> -->
<clear />
<!-- add a VSTS feed -->
<add key="MyGreatFeed" value="https://fabrikam.pkgs.visualstudio.com/DefaultCollection/_packaging/MyGreatFeed/nuget/v3/index.json" />
<!-- also get packages from the NuGet Gallery -->
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
</packageSources>
<activePackageSource>
<add key="All" value="(Aggregate source)" />
</activePackageSource>
</configuration>
For this issue : "it seemed to ONLY download from that source and ignored all the defaults, such as nuget.org, etc."
Make sure you have correctly set the NuGet.config
file and the nuget.org
source is not excluded.
To Restore NuGet packages in Build you can follow the steps mentioned in below article:
Restore Package Management NuGet packages in Team Build
- If you've checked in a NuGet.config, select Feeds in my NuGet.config and select the file from your repo.
- If you're using a single VSTS/TFS feed, select the Feed(s) I select here option and select your feed from the dropdown.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With