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

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

问题描述

我在 Jenkins 中定义了以下步骤.

I have defined below steps in Jenkins.

我可以看到 NuGet 正在恢复 Jenkins 控制台上的包,但是一旦 msbuild 开始构建,它就会失败并出现以下错误解决方案中的项目.

I can see that NuGet is restoring the packages on Jenkins console, but once msbuild starts building, it's failing with below error for all projects in the solution.

错误:

"C:Program Filesdotnetsdk2.1.402SdksMicrosoft.NET.Sdk argetsMicrosoft.PackageDependencyResolution.targets(198,5):错误 NETSDK1064:包 Microsoft.EntityFrameworkCore.Analyzers,版本2.1.3 未找到.它可能在 NuGet 还原后已被删除.否则,NuGet 还原可能仅部分完成,这可能是由于最大路径长度限制."

"C:Program Filesdotnetsdk2.1.402SdksMicrosoft.NET.Sdk argetsMicrosoft.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!

推荐答案

我最终得到了这个工作.我不确定它是对还是错,如果有错请纠正我.我正在使用

I got this working eventually. I am not sure if it's right or wrong and please correct me in case it's wrong. I am doing the restore using

MSBuild.exe /t:Restore MySln.sln

而不是 nuget restore 并且现在成功了.

instead of nuget restore and this is successful now.

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

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