如何用Microsoft.Azure.Storage.Blob替换Microsoft.WindowsAzure.Storage [英] How to replace Microsoft.WindowsAzure.Storage with Microsoft.Azure.Storage.Blob

查看:76
本文介绍了如何用Microsoft.Azure.Storage.Blob替换Microsoft.WindowsAzure.Storage的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的asp.net mvc应用程序中,我正在使用Microsoft.WindowsAzure.Storage 8.0.1从azure云容器上载/下载blob.现在,NuGet软件包管理器通知我,Microsoft.WindowsAzure.Storage已被弃用,我应该使用Microsoft.Azure.Storage.Blob.

In my asp.net mvc application I am using Microsoft.WindowsAzure.Storage 8.0.1 for uploading/downloading blob to/from an azure cloud container. Now NuGet Package Manager informed me that Microsoft.WindowsAzure.Storage is deprecated and that I should use Microsoft.Azure.Storage.Blob.

问题:

  1. 当我继续使用Microsoft.WindowsAzure.Storage 8.0.1时,我会遇到什么问题?
  2. 是否有建议的方法将Microsoft.WindowsAzure.Storage 8.0.1替换为Microsoft.Azure.Storage.Blob?
  3. 当我将Microsoft.WindowsAzure.Storage 8.0.1替换为Microsoft.Azure.Storage.Blob时,是否需要重新编写代码来处理上载/下载Blob?

任何帮助和建议将不胜感激.

Any help and advice will be appreciated.

推荐答案

首先,需要进行一些更正. Microsoft.Azure.Storage.Blob 已由较新的SDK取代 Azure.Storage.Blobs ,建议您升级到新版本(v12SDSK).微软这样做是为了更新其所有SDK以遵循统一的API标准.您可以在此处

First of all, one little correction. Microsoft.Azure.Storage.Blob has been replaced by a newer SDK Azure.Storage.Blobs and it is recommended you upgrade to the new one (v12 SDSK) instead. It was a move by Microsoft to update all their SDKs to follow unified API standard. You can read more about that here

当我继续使用Microsoft.WindowsAzure.Storage 8.0.1时,我会遇到什么问题?

Into what problems could I run, when I keep on using Microsoft.WindowsAzure.Storage 8.0.1?

已弃用WindowsAzure.Storage,最新版本9.3.3已于2018年11月发布.尽管它仍然可以运行且尚未脱离支持,但建议移至较新的

WindowsAzure.Storage is deprecated and the last version 9.3.3 was release on Nov 2018. Though it still works and not yet out of support, but it is recommended to move to the newer Azure.Storage.Blobs package to leverage better performance, update, feature release and continued support in future.

是否有建议的方法将Microsoft.WindowsAzure.Storage 8.0.1替换为Microsoft.Azure.Storage.Blob?

Are there any recommended ways to replace Microsoft.WindowsAzure.Storage 8.0.1 with Microsoft.Azure.Storage.Blob?

如开头所述,正确的软件包为 Azure.Storage.Blobs 实际上.在更新指南和提示中有一篇很好的文章

As mentioned in the beginning, correct package is Azure.Storage.Blobs actually. There is a good article on the update guide and tips here

当我将Microsoft.WindowsAzure.Storage 8.0.1替换为Microsoft.Azure.Storage.Blob时,是否需要重新编写代码以处理上载/下载Blob?

When I replace Microsoft.WindowsAzure.Storage 8.0.1 with Microsoft.Azure.Storage.Blob, will I have to re-write my code for dealing with uploading/downloading blob?

升级到旧版软件包 Microsoft.Azure.Storage.Blob 几乎不需要更改代码.但是最新的SDK Azure.Storage.Blobs 将需要您进行一些更改.如所述这里,名称空间,类,方法有一些更改.

Upgrading to the older package Microsoft.Azure.Storage.Blob will need very little change in code. But the latest SDK Azure.Storage.Blobs will need you some changes. As described here, there several changes in namespace, classes, methods.

|  Package  |    Old Microsoft.Azure.Storage.Blob   |   v12   Azure.Storage.Blobs   |
|:---------:|:-------------------------------------:|:-----------------------------:|
| Namespace | Microsoft.Azure.Storage.Blob.Protocol | Azure.Storage.Blobs.Models    |
| Namespace | Microsoft.Azure.Storage.Blob          | Azure.Storage.Blobs           |
| Namespace | Microsoft.Azure.Storage               | Azure                         |
| Class     | CloudBlobClient                       | BlobServiceClient             |
| Class     | CloudBlobContainer                    | BlobContainerClient           |
| Class     | CloudBlockBlob                        | BlobClient or BlockBlobClient |
| Class     | StorageException                      | RequestFailedException        |
| Class     | BlobErrorCodeStrings                  | BlobErrorCode                 |

更新:由于您使用的是.net Framework 4.5.2,因此 Microsoft.Azure.Storage.Blob .

UPDATE: Since you are using .net framework 4.5.2, Azure.Storage.Blobs is not supported for you. You would have to go with Microsoft.Azure.Storage.Blob.

这篇关于如何用Microsoft.Azure.Storage.Blob替换Microsoft.WindowsAzure.Storage的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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