C#异步功能被卡住

时间:2019-07-05 20:14:56

标签: c# asynchronous async-await

我对C#异步调用还很陌生,所以请帮助我理解为什么对以下函数的调用会停留在等待行:

public async Task<string> UploadBlob(string containerName, string blobName, string blobText)
        {
            var blobContainer = this.cloudBlobClient.GetContainerReference(containerName);
            Console.WriteLine("uploading blob now ....");
            CloudBlockBlob blob = blobContainer.GetBlockBlobReference(blobName);

            await blob.UploadTextAsync(blobText); // gets stuck here

            return blob.Uri.ToString();
        }

我正在尝试将文本上传到azure blob存储,并想返回新上传的blob的uri。

0 个答案:

没有答案