I have just created a workspace on a new machine, got latest of our project from TFS, enabled NuGet Restore, and I get the following (skimmed-down) output:
1>------ Rebuild All started: Project: Caching, Configuration: Debug Any CPU ------
1> Restoring NuGet packages...
1> To prevent NuGet from downloading packages during build, open the Visual Studio Options dialog, click on the Package Manager node and uncheck 'Allow NuGet to download missing packages'.
1> All packages listed in packages.config are already installed.
1> Caching Framework -> C:MyProjLocationCachinginDebugCaching.dll
2>------ Rebuild All started: Project: Library, Configuration: Debug Any CPU ------
2>C:Program Files (x86)MSBuild12.0inMicrosoft.Common.CurrentVersion.targets(1635,5): warning MSB3245: Could not resolve this reference. Could not locate the assembly "LumenWorks.Framework.IO". Check to make sure the assembly exists on disk. If this reference is required by your code, you may get compilation errors.
2>C:MyProjLocationLibrarySomeClass.cs(2,7,2,17): error CS0246: The type or namespace name 'LumenWorks' could not be found (are you missing a using directive or an assembly reference?)
========== Rebuild All: 1 succeeded, 1 failed, 0 skipped ==========
None of the NuGet packages were restored (there are over 10 - I removed them from the above output for readability sake).
It looks like NuGet is not even trying to restore the packages for the second project (Library).
I have already tried moving the NuGet targets import below the CSharp targets import in the Library.csproj
file, as mentioned here, but it's still not working:
<Import Project="$(MSBuildToolsPath)Microsoft.CSharp.targets" />
<Import Project="$(SolutionDir).nugetNuGet.targets" Condition="Exists('$(SolutionDir).nugetNuGet.targets')" />
I am running the latest version of NuGet (2.7.41101.371) on Visual Studio 2013.
Edit: The packages.config
exists and the NuGet Package Manager has the Library project ticked with the correct packages.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…