Missing nuget packages error while using msbuild from command line -
i working on silverlight app. using nuget packages dont check in packages , packages should restored while building. solution compiles in visual studio. trying add compile task in command line using msbuild
exec { c:\windows\microsoft.net\framework\v4.0.30319\msbuild.exe $slnfile /p:outputpath=$outputpath /p:configuration=release /p:solutiondir=$rootdir\source\ /verbosity:minimal /nologo /m:4 } "build failed
before doing step, i'm doing nuget restore explicitly.
exec { c:\project\nuget.exe restore $solutionfile} "restore failed"
this step passes message "all packages listed in packages.config" installed.
but when actual build step happens build fails message
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 \source\.nuget\nuget.targets.
i doing nuget restore explicitly , have enabled
"allow nuget download missing packages" in visual studio , "enable nuget package restore" in solution level.
my nuget.config has "disablesourcecontrolintegration" value="true"
i have seen similar issues in stackoverflow , have tried above solutions suggested. don't have clue why fails in spite of these.
you not need both nuget.exe restore , have msbuild use nuget.targets restore nuget packages. should choose 1 or other.
i suspect problem in case $rootdir not defined , solutiondir property passing msbuild is:
\source
in project file have:
<import project="$(solutiondir)\.nuget\nuget.targets" condition="exists('$(solutiondir)\.nuget\nuget.targets')" />
so if solutiondir \source solution fail compile same error message.
Comments
Post a Comment