此版本的存储模拟器不支持此请求的REST版本 [英] The REST version of this request is not supported by this release of the Storage Emulator

查看:85
本文介绍了此版本的存储模拟器不支持此请求的REST版本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

升级我的Azure Storage Explorer版本后,我的代码停止使用以下消息:

After upgrading my version of Azure Storage Explorer, my code stop working with the following message:

此版本的发行版不支持此请求的REST版本 存储模拟器.请将存储模拟器升级到 最新版本.有关更多信息,请参考以下URL: http://go.microsoft.com/fwlink/?LinkId=392237 "

"The REST version of this request is not supported by this release of the Storage Emulator. Please upgrade the storage emulator to the latest version. Refer to the following URL for more information: http://go.microsoft.com/fwlink/?LinkId=392237"

我的Azure Storage Explorer版本是0.8.16.

My version of Azure Storage Explorer is 0.8.16.

基本上,要上传到天蓝色的代码通常是这样的:

Basically the code to upload to azure tends to be like:

CloudStorageAccount storageAccount = CloudStorageAccount.Parse("UseDevelopmentStorage=true");        
CloudBlobClient blobClient = storageAccount.CreateCloudBlobClient();
CloudBlobContainer blobContainer = blobClient.GetContainerReference("mycontainer");
blobContainer.CreateIfNotExistsAsync();
CloudBlockBlob blockBlob = this.blobContainer.GetBlockBlobReference(fileName);
byte[] CoverImageBytes = null; 
BinaryReader reader = new BinaryReader(file.OpenReadStream()); 
CoverImageBytes = reader.ReadBytes((int)file.Length);
await blockBlob.UploadFromByteArrayAsync(CoverImageBytes, 0,(int)file.Length);

该异常抛出在最后一行.

The exception throws at the last line.

更新

1)您正在运行的存储模拟器的版本是什么?

1) What is the version of storage emulator you're running?

V5.1

2)在您的代码中,您正在使用什么版本的Storage Client库?

2) In your code, what is the version of Storage Client library you're using?

8.4.0 此处

推荐答案

出现此错误的原因是因为Storage Client Library 8.4的目标是REST API版本2017-04-17,其中Storage Emulator Version 5.1的目标是REST API版本.

The reason you're getting this error is because Storage Client Library 8.4 targets REST API version 2017-04-17 where as Storage Emulator Version 5.1 targets REST API version 2016-05-31.

您可以执行以下两项操作之一:

You can do one of the two things:

  1. 安装最新版本的Storage Emulator(当前为5.2).
  2. 将存储客户端库降级到8.3,该库支持REST API版本2016-05-31.

我的建议是与#1配合使用,即使用最新版本的Storage Emulator.

My recommendation would be to go with #1 i.e. use the latest version of Storage Emulator.

这篇关于此版本的存储模拟器不支持此请求的REST版本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆