Nexus:错误 NU1301:无法从远程源检索有关“Microsoft.NET.Test.Sdk”的信息

问题描述 投票:0回答:1

我已使用 Helm Kubernetes 集群通过 Terraform 将 Nexus 从

3.29.0
升级到
3.58.1
,现在收到以下错误:

[2023-08-14T08:05:46.935Z] C:\Users\Deployer\workspace\MyApp\MyApp.View.Test.csproj : error NU1301: Failed to retrieve information about 'Microsoft.NET.Test.Sdk' from remote source 'https://mynexus.com/repository/nuget-group/FindPackagesById()?id='Microsoft.NET.Test.Sdk'&semVerLevel=2.0.0'. [C:\Users\Deployer\workspace\MyApp\myapp.sln]

我没有对任何 nuget-repository、nuget-group 和 nuget-proxy 进行任何更改。

为什么我会收到此错误?怎么解决?

kubernetes terraform nuget nexus nexus3
1个回答
0
投票

我通过将

Protocol Version
nuget-proxy
更改为
NuGet V2
来修复此问题。 Nexus 升级后,它被设置为
NuGet V3

参考截图如下:

在您的 Terraform 代码中,如果您使用

nexus_repository_nuget_proxy
,则按如下方式更改代码:

resource "nexus_repository_nuget_proxy" "nuget_proxy" {
...
  query_cache_item_max_age = 1440
  nuget_version            = "V2"
...
}

在您的 Terraform 代码中,如果您使用

nexus_repository
,则按如下方式更改代码:

resource "nexus_repository" "nuget_proxy" {
...
  nuget_proxy {
    query_cache_item_max_age = 1440
    nuget_version            = "V2"
  }
...
}
© www.soinside.com 2019 - 2024. All rights reserved.