Problem consuming Visual Studio Online package feed


We have both an internal TeamCity NuGet feed, and an additional Visual Studio Online feed set up via the new Packages functionality in VSO.

We're able to consume packages from TC's feed just fine, but TC fails to find the correct versions of packages stored in the VSO feed at the Package Dependency Satisfaction step in our build. The error is the same for each VSO package -  Unable to find version X.X.X of package Y, when the version specified definitely exists in the VSO feed, and can be consumed correctly on local builds.

I've configured credentials via a build feature, and I believe these are working correctly, since before I did so I was getting authentication issues which I'm not seeing any more in the build logs.

If I use package manager console, and issue a get-package -ListAvailable against the VSO source with an appropriate filter, it correctly returns the version in question.

I've also (against my better judgement!) added feed details to NuGet.config and checked in as part of the build, but this doesn't seem to have helped.

Anyone seen anything similar? Is there a step / setting I need to configure to consume from VSO?

An alternative would be to push the VSO packages directly into TC as .nupkgs, but everything I've read seems to indicate that this isn't possible via the .svc that's exposed - can anyone confirm if this is possible, and if so point me to some appropriate docs - my google-fu is not so strong on this one :)


Comment actions Permalink

Hi Richard,

Sorry for delay in replying. 

What TeamCity version do you use?

Could you please try to run the same command as used by TeamCity via command line on the agent machine? You can find the command in the build log. Are all packages restored? Please use the following guidelines to investigate the issue and attach the requested logs. Thank you!

Comment actions Permalink

One solution to this problem is indeed to add a nuget.config and commit it to the repository. I believe that the password will need to be plain text as encrypted passwords are on a per machine basis. An example config is as follows:


<?xml version="1.0" encoding="utf-8"?>
<!-- Allow NuGet to download missing packages -->
<add key="enabled" value="True" />
<!-- Automatically check for missing packages during build in Visual Studio -->
<add key="automatic" value="True" />
Used to specify the default Sources for list, install and update.
See: NuGet.exe help list
See: NuGet.exe help install
See: NuGet.exe help update
<add key="VSO" value="https://[yourOrganiastion][packageFeed]/nuget/v3/index.json" />
<!-- used to store credentials -->
<add key="Username" value="[username]" />
<add key="ClearTextPassword" value="[password]" />
<!-- Used to specify which one of the sources are active -->
<!-- this tells that all of them are active -->
<add key="All" value="(Aggregate source)" />
<!-- Used to disable package sources -->
<disabledPackageSources />
Used to specify default API key associated with sources.
See: NuGet.exe help setApiKey
See: NuGet.exe help push
See: NuGet.exe help mirror




Please sign in to leave a comment.