如何在 Visual Studio 2015 中使用 NuGet 4.x?

How to use NuGet 4.x with Visual Studio 2015?

我坚持使用 VS 2015,因为我们还有 Silverlight 位(正在移植到 HTML)。因此我不能使用 VS 2017(我可以,但不是所有代码,这很痛苦)。

VS 2015 不允许我安装使用仅在 NuGet 4.x 中可用的功能的 NuGet 包,因为 VS 2015 的 NuGet 包管理器等同于 NuGet 3.x

是否可以使 VS 2015 与 NuGet 一起工作4.x?

这是不可能的。 NuGet 4.x 是 Visual Studio 2017 的一部分,对于 Visual Studio 2015,最新版本是 3.6.0.

Is it possible to make VS 2015 work with NuGet 4.x ?

恐怕你不能那样做。因为 NuGet Package Manager 扩展 4.x 不是单独的扩展,它内置于 Visual Studio 2017,我们无法从 NuGet.org.

中获取它

此外,Announcing NuGet 4.0 RTM还指出了这一点:

The NuGet 4.0 Package Manager Extension is currently not available for Visual Studio 2015 (Visual Studio 2015 comes with NuGet 3.4.4, and NuGet 3.5.0 is available as an explicit download for Visual Studio 2015 as well). NuGet 4.0 builds upon several new features and bug fixes available only in Visual Studio 2017, and hence the newer NuGet experiences will not be available in Visual Studio 2015.

希望对您有所帮助。