我正在尝试使用Azure Devops创建新的构建流程。我可以构建整个解决方案,但是无法为同一解决方案中的单个项目构建。
我遇到了以下错误:
nuget命令失败,退出码为(1),错误信息为(无法确定要还原NuGet包的包文件夹。请指定-PackagesDirectory或-SolutionDirectory。) 包还原失败
请问有人能帮帮我吗?
我正在尝试使用Azure Devops创建新的构建流程。我可以构建整个解决方案,但是无法为同一解决方案中的单个项目构建。
我遇到了以下错误:
nuget命令失败,退出码为(1),错误信息为(无法确定要还原NuGet包的包文件夹。请指定-PackagesDirectory或-SolutionDirectory。) 包还原失败
请问有人能帮帮我吗?
packages.config
/项目文件还原一个项目的Nuget包时,我们应该展开nuget还原任务上的高级选项,然后指定一个目录,我将其设置为默认包目录,..\packages
。然后测试它,它成功还原了:2019-02-01T06:18:22.1311238Z ##[section]Starting: NuGet restore
....
2019-02-01T06:18:28.3155511Z [command]C:\VSTS-vs2017-agent\_work\_tool\NuGet\4.3.0\x64\nuget.exe restore C:\VSTS-vs2017-agent\_work\5\s\TestSample\TestSample\TestSample.csproj -PackagesDirectory ..\packages -Verbosity Detailed -NonInteractive -ConfigFile C:\VSTS-vs2017-agent\_work\5\Nuget\tempNuGet_169.config
2019-02-01T06:18:37.0366771Z All packages listed in packages.config are already installed.
2019-02-01T06:18:37.0594978Z ##[section]Finishing: NuGet restore
2019-02-01T06:18:22.1311238Z ##[section]Starting: NuGet restore
2019-02-01T06:18:22.1319968Z ==============================================================================
2019-02-01T06:18:37.0366199Z C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\MSBuild\15.0\bin\msbuild.exe "C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\NuGetScratch\svd0ok2h.e2f.nugetinputs.targets" /t:GenerateRestoreGraphFile /nologo /nr:false /v:q /p:NuGetRestoreTargets="C:\Windows\ServiceProfiles\NetworkService\AppData\Local\Temp\NuGetScratch\bhkdd2rf.itk.nugetrestore.targets" /p:RestoreTaskAssemblyFile="C:\VSTS-vs2017-agent\_work\_tool\NuGet\4.3.0\x64\nuget.exe" /p:RestoreConfigFile="C:\VSTS-vs2017-agent\_work\5\Nuget\tempNuGet_169.config" /p:RestorePackagesPath="..\packages"
2019-02-01T06:18:37.0366350Z
2019-02-01T06:18:37.0366771Z All packages listed in packages.config are already installed.
2019-02-01T06:18:37.0594978Z ##[section]Finishing: NuGet restore
$(SolutionDir)
更改为$(ProjectDir)..\
,我仍然会收到undefined错误。 - HariHaran