I have a private NuGet package feed running, which I use to share certain functions and extensions between my projects. It works great in Visual Studio, but lately I've started setting up a continuous integration build for one of my projects on Visual Studio Online, and it seems that VSO can't see my private feed.
I'm using the new package restore method - the one that involves setting the "Allow NuGet to download missing packages" checkbox in the VS options. I'm not using the "Enable NuGet Package Restore" option in the solution context menu, because this is actually the old way of doing it and causes problems elsewhere.
I'm also not doing anything that modifies my project files; I'm using a custom build definition (using the XAML Workflow stuff) so that I can apply it to any of my projects by just picking it from the "Build process template" dropdown under the build definition editor. I'm doing it this way because I'm adding a variety of other steps including some post-build scripts to facilitate automated deployment to a hosting server; some of these steps are a little complex, so keeping them in the build process means I only have to set them up once.
So, without using the old context-menu solution that places nuget.exe into the solution folder, and without messing with the project itself, how can I get VSO's build to restore packages from my private feed?
The build workflow template has an activity "NuGetRestore", which can take commandline arguments. I've added the following:
"-source https://www.nuget.org/api/v2/ http://www.example.com/nuget"
but that doesn't seem to make a difference. This activity also has a field to "specify the solutions that need their NuGet packages restored", and I've just set that to the ProjectsToBuild
variable which is set when you define the build. I'm not getting any errors from nuget.exe (at least, none that I can see), but the build fails. Interestingly, it says that the relevant namespaces don't exist, and not that the references can't be resolved. Any ideas?