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

升级AWS S3 NuGet包至3.7.101.25后遇EndpointResolver找不到处理程序错误

AWS S3 NuGet升级后Cannot find a handler of type EndpointResolver错误解决方法

升级AWS S3 NuGet包从3.7.1.2到3.7.101.25后,创建AmazonS3Client对象时抛出以下错误:

System.InvalidOperationException HResult=0x80131509
Message=Cannot find a handler of type EndpointResolver
Source=AWSSDK.Core

相关代码:

var amazonS3Config = new AmazonS3Config()
{
    MaxErrorRetry = maxRetryAttempts,
    Timeout = TimeSpan.FromSeconds(requestTimeoutInSecond),
    ServiceURL = serviceURL
};
s3Client = new AmazonS3Client(key, secret, amazonS3Config);

解决步骤:

  • 统一AWS SDK组件版本:确保AWSSDK.Core与AWSSDK.S3版本完全一致(均为3.7.101.25)。SDK各组件版本不匹配会导致依赖逻辑冲突,在NuGet包管理器中批量升级所有AWS相关包即可。
  • 显式指定EndpointResolver:在AmazonS3Config中手动配置默认的端点解析器,覆盖自动注册逻辑:
    var amazonS3Config = new AmazonS3Config()
    {
        MaxErrorRetry = maxRetryAttempts,
        Timeout = TimeSpan.FromSeconds(requestTimeoutInSecond),
        ServiceURL = serviceURL,
        EndpointResolver = new Amazon.Runtime.Internal.DefaultEndpointResolver()
    };
    s3Client = new AmazonS3Client(key, secret, amazonS3Config);
    
  • 清理并重新还原NuGet包:删除项目根目录下的packages文件夹,执行解决方案清理操作,再重新运行NuGet还原,清除缓存的旧版本依赖文件。
  • 检查依赖完整性:确认项目中未遗漏必要的AWS扩展包(如AWSSDK.Extensions.NETCore.Setup),不过多数情况下,版本对齐即可解决问题。

内容的提问来源于stack exchange,提问作者Suresh Raji

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.08.07 16:55:24