[英]An unhandled exception of type 'System.StackOverflowException' occurred in Microsoft.WindowsAzure.Storage.dll
I am presently working with windows 10 universal application, here i am working with azure storage. 我目前正在使用Windows 10通用应用程序,这里我正在使用azure存储。
I am getting above error when i downloading file file from windows azure storage. 当我从windows azure存储下载文件文件时,我遇到了上述错误。
Here is my download code: 这是我的下载代码:
private async Task<int> DownloadFromAzureStorage()
{
try
{
// create Azure Storage
CloudStorageAccount storageAccount = CloudStorageAccount.Parse("DefaultEndpointsProtocol=https;AccountName=<myaccname>;AccountKey=<mykey>");
// create a blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// create a container
CloudBlobContainer container = blobClient.GetContainerReference("sample");
await container.CreateIfNotExistsAsync();
// create a block blob
CloudBlockBlob blockBlob = container.GetBlockBlobReference("abc.jpg");
FileSavePicker openPicker = new FileSavePicker();
openPicker.SuggestedStartLocation = PickerLocationId.PicturesLibrary;
openPicker.FileTypeChoices.Add("File", new List<string>() { ".jpg" });
openPicker.SuggestedFileName = "New Documents";
var imgFile = await openPicker.PickSaveFileAsync();
await blockBlob.DownloadToFileAsync(imgFile); **//Error occuring in this line**
return 1;
}
catch
{
// return error
return 0;
}
}
File Uploading to my azure storage is success, but when i download to my uploaded my it showing the error is "An unhandled exception of type 'System.StackOverflowException' occurred in Microsoft.WindowsAzure.Storage.dll" in await blockBlob.DownloadToFileAsync(imgFile); 文件上传到我的azure存储是成功的,但当我下载到我的上传我显示错误是“在Microsoft.WindowsAzure.Storage.dll中发生类型'System.StackOverflowException'未处理的异常” 等待blockBlob.DownloadToFileAsync(imgFile ); Line
线
please help me to resolve this issue.. 请帮我解决这个问题..
This is a known issue with the DownloadToFileAsync() method in the Win10 Universal Storage Client (unfortunately). 这是Win10 Universal Storage Client中的DownloadToFileAsync()方法的一个已知问题(遗憾的是)。 The bug is fixed in the current preview release (7.0.2-preview), and will be fixed in an upcoming non-preview release.
该错误已在当前预览版本(7.0.2预览版)中修复,并将在即将发布的非预览版本中修复。 To fix your issue for now, please change your DownloadToFile call to the following:
要解决您现在的问题,请将您的DownloadToFile调用更改为以下内容:
await blockBlob.DownloadToFileAsync(imgFile, null, null, null, CancellationToken.None);
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.