如何在Visual Studio 2013中安装WindowsAzure.Storage?

6
注意: 这个答案对我没有帮助,因为我没有相同的dll: System.Collections.Immutable 1.1.37。
我正在使用Visual Studio 2013和 .net 4.5,并按照这篇教程操作:使用.NET开始使用Azure Blob存储,但是在尝试安装WindowsAzure.Storage时出现以下错误:

试图解决依赖'Microsoft.Data.OData (≥ 5.8.2)'。 试图解决依赖'System.Spatial (= 5.8.2)'。 试图解决依赖'Microsoft.Data.Edm (= 5.8.2)'。 试图解决依赖'Newtonsoft.Json (≥ 6.0.8)'。 试图解决依赖'Microsoft.Data.Services.Client (≥ 5.8.2)'。 试图解决依赖'System.Net.Requests (≥ 4.0.11)'。 试图解决依赖'System.ComponentModel.EventBasedAsync (≥ > 4.0.11)'。 试图解决依赖'System.Dynamic.Runtime (≥ 4.0.0)'。 试图解决依赖'System.Linq.Queryable (≥ 4.0.0)'。 'System.Linq.Queryable 4.0.0' 包需要NuGet客户端版本'3.0'或以上,但当前的NuGet版本为'2.12.0.817'。 enter image description here

当我按照图片中的红色错误升级Nuget时,它带我进入“Extensions and Updates”页面,并要求我更新以下内容: enter image description here 我不知道我正在寻找的和这个有什么关系,但我还是去更新了它,但出现了错误: enter image description here 从这里我该怎么做呢?
基于Simsons的评论,我已经检查过我的处理器是否支持虚拟化: enter image description here

1
看起来你的电脑上未启用虚拟化或处理器不支持虚拟化,请按照以下步骤检查是否已启用:https://www.technorms.com/8208/check-if-processor-supports-virtualization - Simsons
我的处理器支持虚拟化,我已经更新了答案并提供了这个信息。 - user1019042
你使用的是哪个版本的Windows? - Simsons
3个回答

13

当你尝试通过NuGet安装WindowsAzure.Storage包时,会遇到以下错误:

试图解析依赖项“System.Linq.Queryable(≥4.0.0)”。“System.Linq.Queryable 4.0.0”包需要NuGet客户端版本“3.0”或更高版本,但当前的NuGet版本为“2.12.0.817”

不幸的是,System.Linq.Queryable4.0.0需要NuGet 3.0或更高版本,因此它无法在Visual Studio 2013上使用。

幸运的是,更新的System.Linq.Queryable4.3.0只需要NuGet 2.12,这个版本 可用于 Visual Studio 2013。

所以,要成功通过NuGet在Visual Studio 2013中安装WindowsAzure.Storage:

  1. 如果你还没有,下载并安装NuGet 2.12。(OP已经确认已经拥有此版本)
  2. 在NuGet中安装System.Linq.Queryable 4.3.0
  3. 在NuGet中安装WindowsAzure.Storage

1
打开您的Visual Studio 2013。转到 工具 > NuGet 包管理器 > 包管理器控制台 在包管理器控制台中输入以下内容:
Install-Package NuGet.Client -Version 3.2.0

我尝试使用NuGet客户端版本3.2.0。目前最新版本为4.3(beta)或4.2。所以我不确定它是否适用于版本4.2和4.3,但它肯定适用于NuGet 3.2.0。对于SendGrid和其他软件包,NuGet > 3就足够了。

0

显然,对于Visual Studio 2013,您只能使用NuGet 2.12版本。

https://www.nuget.org

如果您想使用 NuGet 3.x 以及那些需要 NuGet 3.x 的包,您必须升级到 Visual Studio 2015 及以上版本。

而且情况每天都在恶化。无法在早于2015年的VS上安装Json.NET 10.0.2(会出现“'X' already has a dependency defined for 'Y'”错误)。 - GSerg
如果我买不起2015订阅,那么我就没戏了,这个说法正确吗? - user1019042
1
微软对VS 2013和NuGet 2.x的技术支持将持续10年,https://support.microsoft.com/en-us/help/17959/lifecycle-policy-faq-microsoft-developer-tools和https://support.microsoft.com/en-us/lifecycle/search/18649,但您遇到的限制是由包所有者设置的,而不是微软。因此,您需要向包所有者请求帮助,或开发自己的分支,或使用旧版本的该包。当然,最简单的方法是购买最新的Visual Studio。 - Lex Li
@GSerg,我们团队中有些人仍在使用Visual Studio 2013 Update 5,我相信它支持nuget 2.12和Json.NET 10.0.3。 - Scott Koland
@ScottKoland 我改正了。我注意到那是VS 2012。 - GSerg

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接