Jenkins not picking up the nuget restored packages

旧街凉风 提交于 2019-12-08 16:45:58

问题


I have defined below steps in Jenkins.

I could see the nuget restoring the packages on jenkins console but once msbuild starts building its failing with below error for all projects in the solution.

Error:

"C:\Program Files\dotnet\sdk\2.1.402\Sdks\Microsoft.NET.Sdk\targets\Microsoft.PackageDependencyResolution.targets(198,5): error NETSDK1064: Package Microsoft.EntityFrameworkCore.Analyzers, version 2.1.3 was not found. It might have been deleted since NuGet restore. Otherwise, NuGet restore might have only partially completed, which might have been due to maximum path length restrictions."

If I restore the packages using dotnet restore command from command line and trigger the build then its getting passed. So something wrong in restoring the packages from first build step. What I am missing? Thanks in Advance!!


回答1:


I got this working eventually. I am not sure its it right or wrong and please correct me in case its wrong. I am doing restore using "MSBuild.exe /t:Restore MySln.sln" instead of nuget restore and this is success now



来源:https://stackoverflow.com/questions/52417629/jenkins-not-picking-up-the-nuget-restored-packages

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