Tag: 斑点

指定的容器不存在

我遇到了这个错误The specified container does not exist. 让我解释, CloudBlobClient blobStorage = GetBlobStorage(“upload”); CloudBlockBlob blob = BlobPropertySetting(blobStorage, Guid.NewGuid().ToString().ToLower() + Path.GetExtension(file.FileName)); blob.UploadFromStream(file.InputStream); public static CloudBlobClient GetBlobStorage(string cloudBlobContainserName) { CloudBlobClient blobStorage; try { var storageAccount = CloudStorageAccount.FromConfigurationSetting(“StorageConnectionString”); blobStorage = storageAccount.CreateCloudBlobClient(); CloudBlobContainer container = blobStorage.GetContainerReference(cloudBlobContainserName); container.CreateIfNotExist(); var permissions = container.GetPermissions(); permissions.PublicAccess = BlobContainerPublicAccessType.Container; container.SetPermissions(permissions); } catch (Exception ex) { Logger.LogError(Log4NetLogger.Category.Exception, […]