I hope someone can help diagnose what is happening with my build. I am using Visual Studio 2012, NuGet 2.7 and the TFS service (git). I could not get around the following error:
"C:\a\src\src\RecipeDb.Mvc\RecipeDb.Mvc.csproj (361): This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567."
I turned on the package restore function (but I think I heard with nuget 2.7, it doesn't matter). Anyway, I found a useful blog about this issue: Blog article
Here is my current build script:
<?xml version="1.0" encoding="utf-8"?> <Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <PropertyGroup> <OutDir>$(MSBuildThisFileDirectory)bin</OutDir> <Configuration>Release</Configuration> <ProjectProperties> OutDir=$(OutDir); Configuration=$(Configuration); </ProjectProperties> </PropertyGroup> <ItemGroup> <Solution Include="$(MSBuildThisFileDirectory)src\*.sln" /> </ItemGroup> <Target Name="RestorePackages"> <Exec Command=""$(MSBuildThisFileDirectory)src\.nuget\NuGet.exe" restore "%(Solution.Identity)"" /> </Target> <Target Name="Clean"> <MSBuild Targets="Clean" Projects="@(Solution)" Properties="$(ProjectProperties)" /> </Target> <Target Name="Build" DependsOnTargets="RestorePackages"> <MSBuild Targets="Build" Projects="@(Solution)" Properties="$(ProjectProperties)" /> </Target> <Target Name="Rebuild" DependsOnTargets="RestorePackages"> <MSBuild Targets="Rebuild" Projects="@(Solution)" Properties="$(ProjectProperties)" /> </Target> </Project>
and here is my build log:
Build started 9/27/2013 1:01:14 AM. Project "C:\a\src\build.proj" on node 1 (default targets). RestorePackages: "C:\a\src\src\.nuget\NuGet.exe" restore "C:\a\src\src\RecipeDb.sln" Project "C:\a\src\build.proj" (1) is building "C:\a\src\src\RecipeDb.sln" (2) on node 1 (Build target(s)). ValidateSolutionConfiguration: Building solution configuration "Release|Any CPU". Project "C:\a\src\src\RecipeDb.sln" (2) is building "C:\a\src\src\RecipeDb.Mvc\RecipeDb.Mvc.csproj" (3) on node 1 (default targets). C:\a\src\src\RecipeDb.Mvc\RecipeDb.Mvc.csproj(361,5): error : This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567. Done Building Project "C:\a\src\src\RecipeDb.Mvc\RecipeDb.Mvc.csproj" (default targets)
So, I copied his build log and just changed the path where nuget.exe is. The Nuget.exe command seems to work, but apparently it does not load packages. Of course, creating locally works fine (even if I delete the package directory.
tfs nuget msbuild vsts
coding4fun
source share