NuGet not restoring packages from private source on build

Topics: Ecosystem
Nov 28, 2012 at 3:52 PM

I'm having difficulty getting NuGet to restore missing packages on build.  I'm working with a team with multiple programmers in multiple states.  The goal is to be able to retrive the project from source and be able to build it without fixing a bunch of references.  We've put all non-framework dependancies in NuGet packages on a private NuGet source.  I've done the steps I think should cause NuGet to restore the missing assemblies when the project is retrieved from TFS to a virgin machine, but when building in VS 2012, the missing packages are not restored.

My NuGet version is 2.1.31002.9028, (VS 2012)
The packages are in a private package source.

Enable package restore is turned on for the solution.
Allow NuGet to restore packages during build is enabled.

    <add key="enabled" value="True" />
    <add key="NuGet official package source" value="" />
    <add key="MyPrivateServer" value="\\MyPrivateNuGetServer\NUGET" />

Here's how I've setup & tested this.
1) Add the required packages for the projects .
2) build - all is well
3) Check solution in to TFS
4) Close VS
5) Delete local directory (Simulating another dev getting the solution on a clean machine)
6) Fire up VS, get solution
7) Build - No packages are restored. Build fails.

Build Output:
1> All packages listed in packages.config are already installed.
1>C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.targets(1578,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "cognosdotnet_2_0". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.

I apprecite any suggestions.