首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >从api.nuget.org下载“BouncyCastle.1.8.6.1”错误

从api.nuget.org下载“BouncyCastle.1.8.6.1”错误
EN

Stack Overflow用户
提问于 2020-09-23 09:21:37
回答 1查看 217关注 0票数 0

环境: Jenkins 2.249.1在Windows Server 2016上。

正在使用的命令是

代码语言:javascript
运行
复制
nuget.exe install itextsharp.pdfa -PreRelease -Version 5.5.13.2 \
    -OutputDirectory C:/Jenkins/workspace/itext_7_dotnet_pdfxfa_develop/src/extras/packages \
    -Source 'C:/Jenkins/workspace/itext_7_dotnet_pdfxfa_develop/;https://api.nuget.org/v3/index.json'

这是控制台日志的相关部分:

代码语言:javascript
运行
复制
02:17:42  Feeds used:
02:17:42    C:\Jenkins\workspace\itext_7_dotnet_pdfxfa_develop\src\extras\global-packages
02:17:42    C:/Jenkins/workspace/itext_7_dotnet_pdfxfa_develop/
02:17:42    https://api.nuget.org/v3/index.json
02:17:42  
02:17:42  
02:17:42  
02:17:42  Attempting to gather dependency information for package 'itextsharp.pdfa.5.5.13.2' with respect to project 'C:\Jenkins\workspace\itext_7_dotnet_pdfxfa_develop\src\extras\packages', targeting 'Any,Version=v0.0'
02:17:43  Gathering dependency information took 215.09 ms
02:17:43  Attempting to resolve dependencies for package 'itextsharp.pdfa.5.5.13.2' with DependencyBehavior 'Lowest'
02:17:43  Resolving dependency information took 0 ms
02:17:43  Resolving actions to install package 'itextsharp.pdfa.5.5.13.2'
02:17:43  Resolved actions to install package 'itextsharp.pdfa.5.5.13.2'
02:17:43  Retrieving package 'BouncyCastle 1.8.6.1' from 'nuget.org'.
02:17:43  Retrieving package 'iTextSharp 5.5.13.2' from 'C:/Jenkins/workspace/itext_7_dotnet_pdfxfa_develop/'.
02:17:43  Retrieving package 'itextsharp.pdfa 5.5.13.2' from 'C:/Jenkins/workspace/itext_7_dotnet_pdfxfa_develop/'.
02:17:43    GET https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg
02:17:43    OK https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg 165ms
02:17:43  WARNING: Error downloading 'BouncyCastle.1.8.6.1' from 'https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg'.
02:17:43  Could not find file 'C:\Jenkins\workspace\itext_7_dotnet_pdfxfa_develop\src\extras\global-packages\bouncycastle\1.8.6.1\bouncycastle.1.8.6.1.nupkg'.
02:17:43    GET https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg
02:17:43    OK https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg 24ms
02:17:43  WARNING: Error downloading 'BouncyCastle.1.8.6.1' from 'https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg'.
02:17:43  Could not find file 'C:\Jenkins\workspace\itext_7_dotnet_pdfxfa_develop\src\extras\global-packages\bouncycastle\1.8.6.1\bouncycastle.1.8.6.1.nupkg'.
02:17:43    GET https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg
02:17:43    OK https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg 23ms
02:17:43  WARNING: Install failed. Rolling back...
02:17:43  Executing nuget actions took 482.72 ms
02:17:43  Error downloading 'BouncyCastle.1.8.6.1' from 'https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg'.
02:17:43    Could not find file 'C:\Jenkins\workspace\itext_7_dotnet_pdfxfa_develop\src\extras\global-packages\bouncycastle\1.8.6.1\bouncycastle.1.8.6.1.nupkg'.

看起来nuget install正在尝试3次获取bouncycastle.1.8.6.1.nupkg,这似乎是可行的,而且我还验证了https://api.nuget.org/v3-flatcontainer/bouncycastle/1.8.6.1/bouncycastle.1.8.6.1.nupkg是一个有效的URL:当您打开这个链接时,将下载一个nupkg文件。但是,由于一些未知的原因,下载不能工作吗?

已经尝试过

当我将BouncyCastle目录从packagesglobal-packages中删除,然后再次运行作业时,BouncyCastle by nuget install的下载就会成功。

然后,当我第三次运行作业时,如果没有再次清除目录,它就会在相同的错误上再次失败。

在所有情况下,要使nuget install命令成功完成,我需要做什么?

EN

回答 1

Stack Overflow用户

发布于 2020-09-23 11:57:25

我找不到根本原因,而且花了太多的时间,所以我采取了务实的方法。现在,我将始终在构建开始时删除BouncyCastle,如下所示:

代码语言:javascript
运行
复制
sh 'rm --force --recursive ${dest}/global-packages/bouncycastle'

它很脏,我不以它为傲,但它很管用。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/64024833

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档