C# 类型为';的未处理异常;Amazon.Runtime.AmazonServiceException';发生在AWSSDK.dll中
我已尝试向S3存储桶添加对象C# 类型为';的未处理异常;Amazon.Runtime.AmazonServiceException';发生在AWSSDK.dll中,c#,amazon-web-services,amazon-s3,C#,Amazon Web Services,Amazon S3,我已尝试向S3存储桶添加对象 static IAmazonS3 client; client = new AmazonS3Client(Amazon.RegionEndpoint.USEast1); PutObjectRequest request = new PutObjectRequest() { BucketName = bucketName, Key = keyName, FilePath = filePath }; PutObjectResponse response2 = clien
static IAmazonS3 client;
client = new AmazonS3Client(Amazon.RegionEndpoint.USEast1);
PutObjectRequest request = new PutObjectRequest()
{
BucketName = bucketName,
Key = keyName,
FilePath = filePath
};
PutObjectResponse response2 = client.PutObject(request);
使用了上面的代码,在运行上面的代码时,我得到了以下错误
An unhandled exception of type 'Amazon.Runtime.AmazonServiceException' occurred in AWSSDK.dll Additional information: Error downloading regions definition file.
我可以使用控制台添加文件,并使用C#程序下载。没有问题。如何解决此错误?您看到的错误表明无法从AWS加载服务端点说明,但是对于区域和服务的组合(us-east-1,S3),服务端点应该已经内置到AWSSDK.dll中。所以,这令人困惑。您使用的是AWS提供的DLL版本吗?你能将代码放入try/catch并提供堆栈跟踪吗?@JimFlanagan我已经解决了这个问题。谢谢你的投入。问题在于我使用的用户的ACL。