Use VSTS to build a solution with VSTS Packages and old style csproj

佐手、 提交于 2019-12-13 14:24:56

问题


I've a solution that has the following:

  1. multiple libraries net461 with old style csproj
  2. multiple projects net461 with new csproj (Net core libraries and we applications but tatgets net461) and references the old style csproj projects.
  3. I use VSTS Packages to manage some private nuget packages

I've VS 15.3 installed in my laptop and the build is working great but, on VSTS the build is failing. I tried the following scenarios

  1. When I use dotnet restore (the new tooling), the build fail on restore on the old style csproj and mentioned it's failed to build (I made sure to use the tool to restore only no build involved)
  2. When I use nuget restore, I got the below failure message Error : Assets file '[path_to_project_on_agent]\obj\project.assets.json' not found. Run a NuGet package restore to generate this file. which is mentioned here in this github issue https://github.com/Microsoft/vsts-tasks/issues/3762

I need to know what is the correct tasks to get this project building. Thanks,


回答1:


Finally I resolved the issue by

  1. Use NuGet Tool Installer to install Nuget Version 4.3.0
  2. Run Nuget Restore on the Solution file
  3. Use Visual Studio 2015 Build Task without clean and without restore on the Solution File

I hope it helps someone.



来源:https://stackoverflow.com/questions/46155449/use-vsts-to-build-a-solution-with-vsts-packages-and-old-style-csproj

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