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

查看:728
本文介绍了在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,并使用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 $ localNexus before running dotnet 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天全站免登陆