You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

WSL2下升级Azure.Identity 1.11.0遇NU3034签名验证错误求助

解决WSL2 Ubuntu环境下Azure.Identity 1.11.0的NU3034签名验证错误

针对你遇到的NU3034错误,可尝试以下几种解决方案:

  • 核对证书指纹与配置格式
    先本地下载Azure.Identity.1.11.0.nupkg包,执行nuget verify -signatures Azure.Identity.1.11.0.nupkg获取正确的SHA256指纹。然后检查NuGet.Config(WSL用户目录~/.nuget/NuGet/NuGet.Config或项目目录./NuGet.Config)中的trustedSigners配置,确保格式正确:

    <trustedSigners>
      <author name="Microsoft">
        <certificate fingerprint="SHA256:【获取到的正确指纹】" hashAlgorithm="SHA256" />
      </author>
    </trustedSigners>
    
  • 临时跳过签名验证(应急方案)
    若确认包来源可信,可在restore时添加参数绕过验证:

    dotnet restore --ignore-failed-signature-verification
    

    或在NuGet.Config中全局设置(不推荐长期使用,存在安全风险):

    <config>
      <add key="signatureValidationMode" value="ignore" />
    </config>
    
  • 清理NuGet缓存
    缓存损坏可能引发签名验证异常,执行以下命令清理后重新restore:

    dotnet nuget locals all --clear
    
  • 同步WSL2系统时间
    WSL2时间与主机不同步会导致证书有效期校验失败,执行命令同步:

    sudo hwclock -s
    
  • 升级NuGet工具
    旧版NuGet对新签名格式支持可能存在问题,升级到最新版:

    dotnet tool update -g nuget
    

内容的提问来源于stack exchange,提问作者Richard Hunt

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.06.25 15:32:40