詹金斯没有拿起nuget恢复包 [英] Jenkins not picking up the nuget restored packages

查看:210
本文介绍了詹金斯没有拿起nuget恢复包的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在詹金斯(Jenkins)中定义了以下步骤.

I have defined below steps in Jenkins.

我可以看到nuget在jenkins控制台上恢复了软件包,但是一旦msbuild开始为解决方案中的所有项目构建其失败,并出现以下错误.

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.

错误:

"C:\ Program Files \ dotnet \ sdk \ 2.1.402 \ Sdks \ Microsoft.NET.Sdk \ targets \ Microsoft.PackageDependencyResolution.targets(198,5):错误NETSDK1064:包Microsoft.EntityFrameworkCore.Analyzers,版本找不到2.1.3.自从NuGet还原以来,它可能已被删除.否则,由于最大路径长度限制,NuGet还原可能仅部分完成."

"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."

如果我从命令行使用dotnet restore命令还原软件包并触发构建,则它会通过.因此,从第一步构建软件包还原时就出现了问题.我想念的是什么?在此先感谢!

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!!

推荐答案

我最终完成了这项工作.我不确定它是对还是错,请更正我,以防它错了.我正在使用"MSBuild.exe/t:Restore MySln.sln"而不是nuget restore进行还原,现在成功了

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

这篇关于詹金斯没有拿起nuget恢复包的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆