Failure to build on VS Online because of Nuget, works locally

这一生的挚爱 提交于 2020-01-03 06:21:50

问题


Running locally in VS2015. Everything builds fine. If I deploy to VS Online, the build fails as it cannot find HTML Agility Pack, which is in the solution as a Nuget package. I have checked that Restore NuGet Packages is ticked in VS Online.

Any thoughts on anything I'm not doing.


回答1:


OK, I seem to have found the problem. The packages had been checked into source control. Not sure if they should or not, but there we are. By removing them from the packages folder, it then seemed to restore them from Nuget and work this time.




回答2:


If you work with the vNext build system in VSO, all you need to do is to check the Restore NuGet Packages checkbox in the build definition, and choose the .sln file you would like to build.

If you work with one XAML build definition, there are some steps (described here) you need to follow in order to have these NuGet packages restored during the VSO (TFS) build process.

  1. Add following items to the solution. (Content of the nuget.config and .tfignore file can be found here)

  1. Add one build.proj file under the root path of the solution folder. (Content of the build.proj file can be found here)

  2. Create one folder named tools under the root path of the solution folder. Create NuGet sub-folder under tools folder, download and save nuget.exe under tools\NuGet path.

  3. Check in nuget.config, .tfignore, build.proj and tools\NuGet\nuget.exe into TFS version control.

  4. Modify the build definition to choose to build the build.proj file.

Then you will have NuGet packages restored successfully during the TFS build process.



来源:https://stackoverflow.com/questions/32591217/failure-to-build-on-vs-online-because-of-nuget-works-locally

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