在 nexus 上使用 nuget 代理时,dotnet 还原失败 [英] dotnet restore fails when using nuget proxy on nexus

查看:102
本文介绍了在 nexus 上使用 nuget 代理时,dotnet 还原失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在内部网络的 Nexus (v 3.9.0-01) 上有一个 nuget 代理.我自己还没有填充本地 Nexus 存储库(并且不知道它是如何完成的,或者是否出现任何问题),但是,我可以手动上传新包.构建发生在 Bamboo 代理上,无法连接到公共存储库.

I have a nuget proxy on Nexus (v 3.9.0-01) on an internal network. I haven't populated the local Nexus repo myself (and don't know how it was done or if any issues arose), however, I can upload new packages manually. The build takes place on Bamboo agent and cannot be connected to the public repository.

由于隔离,我必须使用 --no-restore 运行 dotnet build/dotnet publish 并使用 --no-restore 恢复包代码>dotnet restore $projectPath --source $localNexus --runtime win-x64

Because of the isolation, I have to run dotnet build / dotnet publish with --no-restore and restore the packages using dotnet restore $projectPath --source $localNexus --runtime win-x64

NuGet.Frameworks.4.7.0 之前,包正在恢复得很好.这个包有 5 个不同的版本(据我所知,官方 nuget repo 的确切副本),只是不是普通的 4.7.0(官方仓库中也不存在).然后,dotnet restore 产生以下输出:

The packages are being restored just fine until NuGet.Frameworks.4.7.0. This package exists in 5 different versions (as far as I can tell exact copy of the official nuget repo), just not plain 4.7.0 (which doesn't exist in the official repo either). Then, dotnet restore produces the following output:

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 $localNexusbefore runningdotnet restore` 强制包,恢复操作也会失败.

The restore operation fails even if I force the package using dotnet add $projectPath package --source $localNexusbefore runningdotnet restore`.

注意:这个包是我项目中Microsoft.VisualStudio.Web.CodeGeneration.Design 的一个依赖.

Note: this package is a dependency of Microsoft.VisualStudio.Web.CodeGeneration.Design in my project.

可能相关:https://issues.sonatype.org/browse/NEXUS-6159(标记为不同的 Nexus 版本)

Possibly related: https://issues.sonatype.org/browse/NEXUS-6159 (tagged with different Nexus version)

问题:

  • 为什么包还原失败(即没有拉出最合适的 4.7.0-xxx)?
  • 是不是因为 Nexus 的一些怪癖?还是损坏的包?
  • 为什么使用 dotnet package add 手动添加有问题的包没有帮助?
  • Why is the package restore failing (i.e. not pulling the most suitable 4.7.0-xxx)?
  • Is it due to some Nexus quirks? Or corrupted package?
  • Why does it not help to add the problematic package manually using dotnet package add?

推荐答案

与 Nexus 3.10 有完全相同的问题,根据此 Nexus 问题,此问题似乎已在 3.14 中解决;https://issues.sonatype.org/browse/NEXUS-17611

Having the exact same problem with Nexus 3.10, it appears this is resolved in 3.14 according to this Nexus issue; https://issues.sonatype.org/browse/NEXUS-17611

这篇关于在 nexus 上使用 nuget 代理时,dotnet 还原失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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