15

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.

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

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'..

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

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

Pierre Arnaud
  • 10,212
  • 11
  • 77
  • 108

2 Answers2

11

Sigh, a team that can't make up their mind about what tools they use, what could possibly go wrong? Well this. And the other rather nasty problem, that package is meant for projects that target CoreCLR and the Win10 flavor of Universal apps. You cannot create nor build such a project on VS2013. So trying to solve the Nuget version problem doesn't buy you anything.

You guys need to get together and hammer-out what projects you are going to work on. If CoreCLR is what everybody wants to do, and do ask why, then everybody must update to VS2015.

Hans Passant
  • 922,412
  • 146
  • 1,693
  • 2,536
  • Hans, thank you for your reply. I was not aware that we somehow smuggled a CoreCLR dependency into our project. That was not deliberate at all, as we are currently building for Win32. To provide some future path to Universal Apps, most of our code is built as PCLs, though; I support that this is probably the issue here which triggered the "NuGet 3.0" dependency. – Pierre Arnaud Sep 30 '15 at 03:27
  • We used System.Collections.Immutable 1.1.36 (for .NET 4.5). Switching to 1.1.37 introduced the dependency on .NET 5.0, which was an accident. – Pierre Arnaud Oct 01 '15 at 07:41
11

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).

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.

Returning to version 1.1.36 of that package solved the issue.

Pierre Arnaud
  • 10,212
  • 11
  • 77
  • 108
  • 1
    I need NuGet 3.0 on VS 2013 because 3.# supports ContentFiles which 2.# does not :( – Phill Jun 01 '16 at 12:16
  • +1 Thank you, I had a similar issue with the new version of Moq, installing a previous version of Moq without that dependency worked! I patiently wait for my team to upgrade to 2015... – EaziLuizi Jun 08 '16 at 13:31
  • This doesn't make any sense. NuGet 3 apparently has a new package source structure, and maybe 3 [doesn't handle the old formal well](https://github.com/NuGet/Home/issues/1909). Does 2 support the new structure? If not, that seems like reason enough to upgrade. – jpmc26 Apr 13 '17 at 18:34