Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AlibabaCloud.SDK.Oss20190517 仍然无法使用 #10

Closed
jacksonwj opened this issue Aug 8, 2022 · 5 comments
Closed

AlibabaCloud.SDK.Oss20190517 仍然无法使用 #10

jacksonwj opened this issue Aug 8, 2022 · 5 comments

Comments

@jacksonwj
Copy link

jacksonwj commented Aug 8, 2022

根据 #7 的说法,该问题已经修复了,但是,又有新的问题了。

调用方法如下:

using Oss = AlibabaCloud.SDK.Oss20190517;

var ossCfg = new Config
{
    AccessKeyId = <Key>,
    AccessKeySecret = <Secret>,
    Endpoint = "oss-cn-hangzhou.aliyuncs.com"
};

var cli = new Oss.Client(ossCfg);

var req = new Oss.Models.ListBucketsRequest
{
    MaxKeys = 500
};

try
{
    // var result = await cli.ListBucketsAsync(req);
    var result = await cli.ListBucketsWithOptionsAsync(req, new Dictionary<string, string>(), new RuntimeOptions());
    if (result == null || result.Body == null || result.Body.Buckets == null ||
        result.Body.Buckets.Buckets == null || result.Body.Buckets.Buckets.Count == 0)
    {
        return new(code: 400, msg: "暂无 Bucket");
    }

    return new(result.Body.Buckets.Buckets, result.Body.Buckets.Buckets.Count);
}
catch (TeaException e)
{
    return new(code: 500, msg: Common.AssertAsString(e.Message));
}
catch (Exception e)
{
    var ex = new TeaException(new Dictionary<string, string>
    {
        { "message", e.Message }
    });

    return new(code: 500, msg: Common.AssertAsString(ex.Message));
}

抛出异常如图所示:

另外,不知道阿里云对于 .NET Core 的 SDK,有没有暂停的计划,如果要暂停了,麻烦告知一下,不然,对于官方 SDK,出现这样的 BUG,感觉有点匪夷所思。

@yndu13
Copy link
Contributor

yndu13 commented Aug 8, 2022

没有暂停计划,遇到问题反馈给我们,我们会持续修复并更新

@yndu13
Copy link
Contributor

yndu13 commented Aug 8, 2022

请将依赖的SDK信息发一下呢,包括AlibabaCloud.TeaXML、AlibabaCloud.GatewayOss、AlibabaCloud.SDK.Oss20190517的版本

@jacksonwj
Copy link
Author

jacksonwj commented Aug 8, 2022

请将依赖的SDK信息发一下呢,包括AlibabaCloud.TeaXML、AlibabaCloud.GatewayOss、AlibabaCloud.SDK.Oss20190517的版本

是这个吗?

BTW. 我的本地环境,IDE 是 VS 2022,.NET 版本如下图

@yndu13
Copy link
Contributor

yndu13 commented Aug 9, 2022

已排查到问题,是该接口的返回值的元数据定义有问题,与实际值不匹配,我们会尽快发布更新

@yndu13
Copy link
Contributor

yndu13 commented Aug 9, 2022

SDK已更新,AlibabaCloud.SDK.Oss20190517 --version 1.0.6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants