No RegionEndpoint or ServiceURL configured

后端 未结 5 1966
野性不改
野性不改 2021-01-01 09:35

I am writing code to upload files to AWS S3 and receiving this exception:

AmazonClientException: No RegionEndpoint or ServiceURL configured

5条回答
  •  离开以前
    2021-01-01 10:16

    The short answer to error...

    Amazon.Runtime.AmazonClientException: No RegionEndpoint or ServiceURL configured

    ...in my case was to specify a region when constructing the client object (for me it was AmazonSimpleEmailServiceClient).

    Assuming you're using BasicAWSCredentials then try this:

    var credentials = new BasicAWSCredentials(accessKeyID, secretKey);
    
    new AmazonS3Client(credentials, RegionEndpoint.USEast1);
    
    //                              ^^^^^^^^^^^^^^^^^^^^^^  add this
    

提交回复
热议问题