It is actually quite easy to call NuGet as a pre-build step. You can override the BeforeBuild target in the * file. * Proj for the project using NuGet links.
<Target Name="BeforeBuild"> <Exec Command=""$(SolutionDir)Tools\nuget" install "$(ProjectDir)packages.config" -o "$(SolutionDir)Packages"" Condition="'$(BuildingInsideVisualStudio)'==''" /> </Target>
As you can see from the above snippet, you will want to download the NuGet command-line utility , put it in a folder under your solution and check it for version control. Note that the executable that you download is actually the bootloader that you want to run once to load the real executable.
Then you will need to check the packages.config file from the project directory, but not the packages folder under your solutions directory. Note that I turned on the check for $ (BuildingInsideVisualStudio), which should not be installed in the previous build step. This will download and install packages during build when you create using the TFS build service (or from the command line). This will not affect your NuGet experience in Visual Studio.
You can search for articles on automating the creation of NuGet packages using TFS - several people have reported this. The combination of these two solutions provides a very effective dependency management solution. Now we just need the NuGet feed built into TFS;).
source share