我创建了一个空的.Net Core应用程序,并为Amazon.Core和Amazon.S3安装了nuget包.
I created an empty .Net Core application and installed nuget packages for Both Amazon.Core and Amazon.S3.
然后我尝试使用S3获取对象,但一开始我就被卡住了……程序集内无处可找到Amazon.AWSClientFactory.即使使用dotPeek,我也尝试搜索此工厂方法,但找不到.甚至来自亚马逊的示例代码也不起作用.
Then I tried to use S3 to get an object but I'm stuck at the very first moment... Amazon.AWSClientFactory is nowhere to be found inside the assembly. Even with dotPeek I tried to search this factory method but I couldn't find it. Even the sample code from Amazon doesn't work.
我应该在哪里找到这个课程?
Where I supposed to find this class ?
推荐答案Amazon.Core和Amazon.S3是适用于.NET v3的AWS开发工具包的一部分.根据适用于.NET版本3的AWS开发工具包SDK迁移指南 :
Amazon.Core and Amazon.S3 are part of the AWS SDK for .NET v3. Per the AWS SDK for .NET Version 3 Migration Guide:
更改:AWSClientFactory已删除
Change: AWSClientFactory is removed
说明:使用服务客户端构造函数而不是AWSClientFactory
Description: Use service client constructors instead of the AWSClientFactory
或者换句话说,使用在Amazon.S3 nuget包中找到的IAmazonS3和AmazonS3Client:
Or in other words, use IAmazonS3 and AmazonS3Client found in the Amazon.S3 nuget package:
using (IAmazonS3 client = new AmazonS3Client()) { // do stuff }进一步阅读
- AWS文档-使用适用于.NET的AWS开发工具包获取对象
- AWS文档-AmazonS3Client
- AWS Documentation - Get an Object Using the AWS SDK for .NET
- AWS Documentation - AmazonS3Client
Further Reading
更多推荐
Amazon AWSClientFactory不存在
发布评论