【问题标题】:Nuget Packages are not found in nexus repo在 nexus 存储库中找不到 Nuget 包
【发布时间】:2019-11-01 02:06:11
【问题描述】:

我正在使用 nexus OSS 3.15.2-01 及其新实例。 我们面临的问题是 nuget 代理存储库,如果我在 nexus 服务器上手动尝试 curl nuget org,它会到达 URL。但是当我尝试从 VS 或 cmd 下载它时,它说找不到文件。

我为 nuget 和新的 repo nuget_gallery 创建了一个单独的 blob,并在代理中提供了 nuget org 来配置它,但它不起作用

从 VS 说,

严重性代码描述项目文件行抑制状态 错误提要“nexus prod [repo URL]”列出了包“Microsoft.AspNet.WebApi.Client.5.2.7”,但多次尝试下载 nupkg 均失败。提要无效或在当前操作正在进行时删除了所需的包。验证提要中存在该包,然后重试。 找不到包“Microsoft.AspNet.WebApi.Client.5.2.7”。

如果我们浏览 repo,如何在 nexus 中获取版本,但即使我们尝试下载它也说找不到文件(0 字节)

【问题讨论】:

    标签: visual-studio continuous-integration package nuget nexus


    【解决方案1】:

    您可以尝试以下提示以检查是否有帮助:

    1.通过命令行清除所有NuGet包缓存:nuget locals all -clear。

    2.关闭所有Visual Studio实例,然后删除C:\Users\xxx\AppData\Roaming\NuGet\NuGet.Config位置的nuget.config文件,然后重新打开Visual Studio恢复nuget包。

    3.检查是否有防火墙策略或其他代理设置阻止了nuget安装包。

    请检查该问题仅在从 Nexus 提取包时出现,还是在您从 nuget.org 下载包时也会出现。或许你可以从this thread得到一些帮助。

    【讨论】:

      【解决方案2】:

      聚会有点晚了,但我也遇到了同样的问题。它似乎下降到lack of NuGet protocol 3 support in Nexus

      解决方法是像这样将 protocolVersion="2" 添加到我的 nuget.config 中;

      <?xml version="1.0" encoding="utf-8"?>
      <configuration>
        <packageSources>
          <!--To inherit the global NuGet package sources remove the <clear/> line below -->
          <clear />
      
          <add key="your-nexus-repo" value="http://your-nexus-repo/nexus/service/local/nuget/your-repo-name/" protocolVersion="2"/>
        </packageSources>
      </configuration>
      

      我仍然遇到 dotnet core 3 包的问题,​​所以还必须重新添加 nuget.org(如果 nuget.org 在您的全局配置中,则删除 &lt;clear/&gt;

      <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
      

      【讨论】:

        猜你喜欢
        • 1970-01-01
        • 1970-01-01
        • 2016-12-23
        • 2017-07-09
        • 2017-03-11
        • 2016-12-29
        • 2020-10-15
        • 2023-04-01
        • 1970-01-01
        相关资源
        最近更新 更多