Nuget Restore in MS Build Step

随声附和 提交于 2020-01-17 00:46:32

问题


In my asp.net web application, i have solution with 5 projects and nuget.org. In TFS Build Definition,

1) While building the whole solution in Visual Studio Build Task

         Nuget packages getting restored.    

2) While trying to generate executable files for individual projects in MS Build Task

If I select Restore Nuget packages, It's not finding nuget packages and step getting failed with message - "Process 'NuGet.exe' exited with code '1'."

I have tried many references online and none worked. Any suggestions on how to solve this?
Do i need to make any changes in the nuget.config file to support restoring
packages to individual projects.


回答1:


Do not directly select Restore Nuget pacakges in MS build task configuration. This option is deprecated. To restore NuGet packages, add a NuGet Installer step before the build.

(Important) This option is deprecated. Make sure to clear this checkbox and instead use the NuGet Installer build step.

Source Link: MSBuild

Besides, you could also build single project not the entire solution in Visual Studio Build task. Just select the project (.*proj) files instead of .sln file. Unless you are building a customized MSBuild project file, then we recommend you use the MSBuild step instead of the Visual Studio Build step.

You could also try to build single project using Visual Studio Build task, see if the issue is still exists.




回答2:


Same problem, downgraded to 4.4.1. it helped



来源:https://stackoverflow.com/questions/48508960/nuget-restore-in-ms-build-step

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!