我在内部网络上的Nexus(v3.9.0-01)上有一个NuGet代理。我没有自己填充本地Nexus存储库(也不知道是如何完成的或是否存在任何问题),但是我可以手动上传新软件包。构建发生在Bamboo代理上,无法连接到公共仓库。
由于处于隔离状态,因此必须使用--no-restore
运行dotnet build
/dotnet publish
并使用dotnet restore $projectPath --source $localNexus --runtime win-x64
来还原软件包。
软件包被还原得很好,直到NuGet.Frameworks.4.7.0
。该软件包存在5个不同版本(据我所知是官方nuget仓库的精确副本),只是不存在纯4.7.0版本(官方仓库中也不存在)。然后,dotnet restore
会产生以下输出:
build 20-Jun-2018 16:24:26 info : GET https://nexus.***.***.***.au/repository/nuget.org-proxy/Microsoft.CodeAnalysis.Workspaces.Common/2.8.0
build 20-Jun-2018 16:24:27 error: The feed 'https://nexus.***.***.***.au/repository/nuget.org-proxy/ [https://nexus.***.***.***.au/repository/nuget.org-proxy/]' lists package 'NuGet.Frameworks.4.7.0' but multiple attempts to download the nupkg have failed. The feed is either invalid or required packages were removed while the current operation was in progress. Verify the package exists on the feed and try again.
build 20-Jun-2018 16:24:27 error: Unable to find package 'NuGet.Frameworks.4.7.0'.
即使我使用dotnet add $projectPath
package --source $localNexus 在运行
dotnet restore之前强制安装包,还是无法恢复操作。
注意:此软件包是我的项目中Microsoft.VisualStudio.Web.CodeGeneration.Design
的依赖项。
可能相关:https://issues.sonatype.org/browse/NEXUS-6159(标记有不同的Nexus版本)
问题:
- 为什么软件包恢复失败(即未拉取最合适的4.7.0-xxx)?
- 这是由于某些Nexus怪癖吗?还是损坏的软件包?
- 为什么手动使用
dotnet package add
添加有问题的软件包没有帮助?