首页 > 解决方案 > 错误 NU3034:来自源“https://api.nuget.org/v3/index.json”的包“...”:此包已签名,但不是由受信任的签名者签名

问题描述

到今天为止,这个消息似乎无法解决。nuget.config 位于 C:\Users[user]\AppData\Roaming\NuGet\nuget.config

将 signatureValidationMode 设置为 accept 而不是 'required' 没有任何区别。nuget 也不同步。

<?xml version="1.0" encoding="utf-8"?>
<configuration>

  <packageSources>
    <add key="nuget.org" value="https://api.nuget.org/v3/index.json" protocolVersion="3" />
  </packageSources>
  <trustedSigners>
    <author name="Microsoft2021">
        <certificate fingerprint="AA12DA22A49BCE7D5C1AE64CC1F3D892F150DA76140F210ABD2CBFFCA2C18A27" hashAlgorithm="SHA256" allowUntrustedRoot="false" />
      </author>
      <repository  name="nuget.org" serviceIndex="https://api.nuget.org/v3/index.json">
       <certificate fingerprint="0e5f38f57dc1bcc806d8494f4f90fbcedd988b46760709cbeec6f4219aa6157d" hashAlgorithm="SHA256" allowUntrustedRoot="true" />
       <certificate fingerprint="5a2901d6ada3d18260b9c6dfe2133c95d74b9eef6ae0e5dc334c8454d1477df4" hashAlgorithm="SHA256" allowUntrustedRoot="true" />
      </repository>
  </trustedSigners>

</configuration>

现在所有的包都被认为是不可信的。你还有其他提示吗?谢谢!

错误 NU3034:来自源“https://api.nuget.org/v3/index.json”的包“Swashbuckle.AspNetCore.SwaggerGen 6.1.3”:此包已签名,但不是由受信任的签名者签名。

标签: nuget

解决方案


最后的答案很简单。Nuget.config 可以有不同的范围,我以为只有两个范围,计算机级别和 VS 2019(2017) 级别。不真实。 https://docs.microsoft.com/nl-nl/nuget/consume-packages/configuring-nuget-behavior#config-file-locations-and-uses

我的解决方案中的 nuget.config 是错误的。删除后,包裹再次被接受。


推荐阅读