NuGet pack command in a TFS Team Build environment

Topics: General
Aug 6, 2014 at 12:41 PM
Edited Aug 6, 2014 at 2:45 PM
Hi NuGet team,

I have to use NuGet pack command in a corporate environment, called from a custom build extension in a customized TFS Build Template.

TFS Team Build outputs the built assemblies to an external drop location (external in terms of the project's source code folder structure) and thus the NuGet pack command can't be used right away for the TFS Team Build scenario as the build outputs are not located in the "bin" folders of the projects:
  • SolutionFolder
    -- + Project1Folder
    ---- + bin (empty)
Instead, all the outputs are getting published to a drop folder, that can be configured (using MSBuild argument /p:GenerateProjectSpecificOutputFolder=true) to look like:
  • DropFolder
    -- + bin
    ---- + PlatformFolder (e.g. "x64")
    ------ + ConfigurationFolder (e.g. "Release")
           -------- + SolutionFolder (e.g. "MySolution")
                      ---------- + Project1Folder (e.g. "MyProject")
                                    ---------- AssemblyList (e.g. "Project1.dll")
I think it would be helpful to have the option on the NuGet "pack" command, to specify explicitly that the output assemblies (the ones that must be included into the "lib" folder of the NuGet package) are residing in an external drop location , rather than in the source code folder structure (as it would have been in a standard Visual Studio build).

Thus, I have created a fork of NuGet source code and added two new arguments to the "pack" command, so that it can also handle the scenario of packaging in a TFS Build environment.

I'm going to commit the changes to my fork soon and I'm going to write a follow up post to describe the exact changes made to the source code (in classes PackCommand and ProjectFactory).

Kind Regards,
Ross Borissov
Aug 6, 2014 at 1:29 PM
I executed the following steps:
  • built the source code successfully from Visual Studio and from the command line "build.cmd" (no errors);
  • committed the changes into the working branch "extend_pack_command" (locally);
  • merged the changes into the "master" branch (locally);
  • pulled from remote origin into the local master (no merge conflicts occurred);
  • pushed the local master branch into the remote origin (my fork).
According to the instructions here , I'm now going to issue a pull request including a detailed description of the changes.