【发布时间】:2015-09-17 03:48:15
【问题描述】:
将图像从我的 web api 上传到 azure blob 存储工作正常,尽管尝试删除它们时出现以下错误: "Microsoft.WindowsAzure.Storage.dll 中发生了类型为 'Microsoft.WindowsAzure.Storage.StorageException' 的异常,但未在用户代码中处理"
这是我使用的代码:
// Retrieve storage account from connection string.
CloudStorageAccount storageAccount = CloudStorageAccount.Parse(
CloudConfigurationManager.GetSetting("StorageConnectionString"));
// Create the blob client.
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
// Retrieve reference to a previously created container.
CloudBlobContainer container = blobClient.GetContainerReference("mycontainer");
// Retrieve reference to a blob named "myblob.txt".
CloudBlockBlob blockBlob = container.GetBlockBlobReference("myblob.txt");
// Delete the blob.
blockBlob.Delete();
非常感谢任何帮助或输入,谢谢!
【问题讨论】:
-
也许您应该查看异常并尝试解释它。发布结果。
-
你能给我们完整的堆栈跟踪吗?
标签: c# asp.net-web-api azure-blob-storage