Skip to content

Async methods fail #1636

@Raphael-Saldanha

Description

@Raphael-Saldanha

After upgrading to the latest version, the EncryptAsync thread remais locked

using (var client = new AmazonKeyManagementServiceClient())
using (var plainText = new MemoryStream(Encoding.UTF8.GetBytes("Amazon Web Services")))
{
    var request = new EncryptRequest
    {
        KeyId = "Aws-Kms-Login-Key",
        Plaintext = plainText
    };
                
    var result = client.EncryptAsync(request).Result.CiphertextBlob.ToArray();
}

To overcome the issue, it is required to run the code within a different task

var result = Task.Run(() => _ = client.EncryptAsync(request).Result).Result.CiphertextBlob.ToArray();

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions