0
votes

I am trying to use NuGet to package and publish the package with TFS Build 2015 to local NuGet Server. I am getting error , I am not sure what am i missing. Thanks for Help.

Here is Error Starting task: NuGet Packager


Set workingFolder to default: C:\Lucky\agent\tasks\NuGetPackager\0.1.58 Executing the powershell script: C:\Lucky\agent\tasks\NuGetPackager\0.1.58\NuGetPackager.ps1 Checking pattern is specified No Pattern found in solution parameter. Found files: 1 --File: "C:\Lucky\agent_work\1\s\Dev\FabrikamFiber.CallCenter" The property DirectoryName does not exist or was not found. Creating Nuget Arguments: --ARGS: pack "C:\Lucky\agent_work\1\s\Dev\FabrikamFiber.CallCenter" -OutputDirectory "C:\Lucky\agent_work\1\s" -Properties Configuration=Release Invoking nuget with pack "C:\Lucky\agent_work\1\s\Dev\FabrikamFiber.CallCenter" -OutputDirectory "C:\Lucky\agent_work\1\s" -Properties Configuration=Release on C:\Lucky\agent\agent\worker\tools\NuGet.exe pack "C:\Lucky\agent_work\1\s\Dev\FabrikamFiber.CallCenter" -OutputDirectory "C:\Lucky\agent_work\1\s" -Properties Configuration=Release MSBuild auto-detection: using msbuild version '14.0' from 'C:\Program Files (x86)\MSBuild\14.0\bin'. Please specify a nuspec or project file to use. Unexpected exit code 1 returned from tool NuGet.exe


Finishing task: NuGetPackager


Task NuGetPackager failed. This caused the job to fail. Look at the logs for the task for more details.

1
What parameters are you providing to the task?Daniel Mann
Can you share the settings of "NugetPackage" task?Eddie Chen - MSFT
Thanks for the help. Answer below is fixed it and also this link from Donovan Brown also helped me understand the flow. donovanbrown.com/post/…Lucky Star

1 Answers

1
votes

According to the error info:

Please specify a nuspec or project file to use. Unexpected exit code 1 returned from tool NuGet.exe

You may specified a wrong argument in nuget package task ,please double check you have followed below requirements:

Specify .csproj files (for example, **\*.csproj) for simple projects. In this case:

  • The packager compiles the .csproj files for packaging.
  • You must specify Configuration to Package (see below).
  • You do not have to check in a .nuspec file. If you do check one in, the packager honors its settings and replaces tokens such as $id$ and $description$.

Specify .nuspec files (for example, **\*.nuspec) for more complex projects, such as multi-platform scenarios in which you need to compile and package in separate steps. In this case:

  • The packager does not compile the .csproj files for packaging.

  • Each project is packaged only if it has a .nuspec file checked in.

  • The packager does not replace tokens in the .nuspec file (except the element, see Use build number to version package, below). You must supply values for elements such as and . The most common way to do this is to hardcode the values in the .nuspec file.

Please double check your arguments , more details please refer this tutorial-- Pack NuGet packages.

Besides you could also enable verbose debug mode by adding system.debug=true to get a more detail build log info for troubleshooting.