Microsoft.WindowsAzure.Storage.dll 中发生了 'System.StackOverflowException' 类型的未处理异常
An unhandled exception of type 'System.StackOverflowException' occurred in Microsoft.WindowsAzure.Storage.dll
我目前正在使用 windows 10 通用应用程序,这里我正在使用 Azure 存储。
我从 windows Azure 存储中下载文件时出现上述错误。
这是我的下载代码:
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;
}
}
文件上传到我的 azure 存储是成功的,但是当我下载到我上传的文件时,它显示错误是 "An unhandled exception of type 'System.WhosebugException' occurred in Microsoft.WindowsAzure.Storage.dll" in await blockBlob.DownloadToFileAsync(imgFile);行
请帮我解决这个问题..
这是 Win10 通用存储客户端中 DownloadToFileAsync() 方法的一个已知问题(很遗憾)。该错误已在当前预览版 (7.0.2-preview) 中修复,并将在即将发布的非预览版中修复。要暂时解决您的问题,请将您的 DownloadToFile 调用更改为以下内容:
await blockBlob.DownloadToFileAsync(imgFile, null, null, null, CancellationToken.None);
我目前正在使用 windows 10 通用应用程序,这里我正在使用 Azure 存储。
我从 windows Azure 存储中下载文件时出现上述错误。
这是我的下载代码:
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;
}
}
文件上传到我的 azure 存储是成功的,但是当我下载到我上传的文件时,它显示错误是 "An unhandled exception of type 'System.WhosebugException' occurred in Microsoft.WindowsAzure.Storage.dll" in await blockBlob.DownloadToFileAsync(imgFile);行
请帮我解决这个问题..
这是 Win10 通用存储客户端中 DownloadToFileAsync() 方法的一个已知问题(很遗憾)。该错误已在当前预览版 (7.0.2-preview) 中修复,并将在即将发布的非预览版中修复。要暂时解决您的问题,请将您的 DownloadToFile 调用更改为以下内容:
await blockBlob.DownloadToFileAsync(imgFile, null, null, null, CancellationToken.None);