visual studio 2013 - The command "C:\Main\Src\.nuget\nuget.exe restore -SolutionDirectory ..\" exited with code 1 -
i've been struggling getting nuget work on week now. got work on local builds, not on tfs 2013 builds. narrowed down nuget not happening during team builds, when added
$(solutiondir).nuget\nuget.exe restore -solutiondirectory ..\
to pre-build event on first project in build order , error. , if execute command command line in solution directory works fine. builds locally fine, on build server "code 1" error. helpful grrrrr! opened source tfs gets before build , tried doing local build on builds server , same error (even though works fine on local machine). tried increased verbosity on team build shows same error. sorry - i've googled error , found many responses, nothing has helped...
btw, when run version of nuget.exe in solution it's version 3.4.3.855.
to enable restore nuget package tfs xaml build, please try follow below steps:
- in vs ide, go tools -> options -> nuget package manager -> enable allow nuget download missing packages.
- delete nuget.exe , nuget.targets files .nuget folder. sure these 2 files deleted version control well.
- remove following tags .proj file:
1. <restorepackages>true</restorepackages> 2.<import project="$(solutiondir)\.nuget\nuget.targets" /> 3. <target name="ensurenugetpackagebuildimports" beforetargets="prepareforbuild"> <propertygroup> <errortext>this project references nuget package(s) missing on computer. enable nuget package restore download them. more information, see http://go.microsoft.com/fwlink/?linkid=322105. missing file {0}.</errortext> </propertygroup> <error condition="!exists('$(solutiondir)\.nuget\nuget.targets')" text="$([system.string]::format('$(errortext)', '$(solutiondir)\.nuget\nuget.targets'))" /> </target>
more details please refer step step tutorial:auto restore nuget packages tfs build right way
Comments
Post a Comment