【问题标题】:dotnet restore fails when using nuget proxy on nexus在 nexus 上使用 nuget 代理时,dotnet 还原失败
【发布时间】:2019-02-15 20:01:59
【问题描述】:

我在内部网络上的 Nexus (v 3.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 个不同的版本(as far as I can tell exact copy of the official nuget repo),只是不是普通的 4.7.0(官方 repo 中也不存在)。然后,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 $localNexusbefore runningdotnet restore`强制打包,恢复操作也会失败。

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

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

问题:

  • 为什么包还原失败(即没有提取最合适的 4.7.0-xxx)?
  • 是不是因为 Nexus 的一些怪癖?还是损坏的包裹?
  • 为什么使用dotnet package add手动添加有问题的包没有帮助?

【问题讨论】:

  • 当您从源存储库请求包时,会从源存储库填充代理存储库。您不能简单地将新包上传到代理存储库 - 您需要一个托管存储库。我怀疑您的 nuget 客户端配置错误。你能从你的 Nexus 和你的 nuget 配置中显示 nuget 存储库吗?
  • 有什么解决办法吗?同样的问题
  • 我正在尝试将我的项目配置为使用已设置的 Nexus 存储库。你能指出我正确的方向,以便我实现这一目标吗?

标签: .net-core nuget nexus


【解决方案1】:

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2017-04-19
    • 2020-09-07
    • 2018-08-31
    • 1970-01-01
    • 1970-01-01
    • 2017-08-16
    • 1970-01-01
    相关资源
    最近更新 更多