如何在 Visual Studio 2013 中使用 NuGet 3.0? [英] How to use NuGet 3.0 with Visual Studio 2013?

查看:72
本文介绍了如何在 Visual Studio 2013 中使用 NuGet 3.0?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个混合环境,其中一些开发人员在 Visual Studio 2013 上工作,而其他人在 2015 上工作.一切正常,直到我们更新了 Visual Studio 2015 中引用的 NuGet 包.

I have a mixed environment where some developers are working on Visual Studio 2013, and others are working on 2015. Everything worked fine until we updated a referenced NuGet package from Visual Studio 2015.

现在,当尝试从 Visual Studio 2013 还原 NuGet 包时,我看到以下错误:

Now, when trying to restore the NuGet packages from Visual Studio 2013, I see the following error:

项目 Foo 的 NuGet 包还原失败:System.Linq 4.0.0"包需要 NuGet 客户端版本3.0"或更高版本,但当前的 NuGet 版本为2.8.60723.765"..

NuGet Package restore failed for project Foo: The 'System.Linq 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.8.60723.765'..

显然,Visual Studio 2013 没有 NuGet 3.x 版.

Apparently, there is no NuGet version 3.x for Visual Studio 2013.

是否有继续使用 Visual Studio 2013 和 2015 的解决方案?

Is there a solution to continue working with both Visual Studio 2013 and 2015?

推荐答案

正如 Hans Passant 在他的回复中所指出的,在仅针对 vanilla .NET 4.5 框架的项目上不需要 NuGet 3.0(这就是 Visual Studio我们的目标是 2013 年).

As Hans Passant noted in his reply, there is no need for NuGet 3.0 on projects which are only targetting the vanilla .NET 4.5 framework (and that's what Visual Studio 2013 was meant to target in our case).

这是添加了更新的 NuGet 包,特别是 System.Collections.Immutable 1.1.37,它引入了对 .NETPlatform,Version=v5.0 的依赖,这反过来触发了对 NuGet 3.0意外依赖.

It was the addition of an updated NuGet package, specifically System.Collections.Immutable 1.1.37, which introduced a dependency on .NETPlatform,Version=v5.0, which in turn triggered the accidental dependency on NuGet 3.0.

返回到该软件包的 1.1.36 版解决了该问题.

Returning to version 1.1.36 of that package solved the issue.

这篇关于如何在 Visual Studio 2013 中使用 NuGet 3.0?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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