Predefined type 'System.ValueTuple´2´ is not defined or imported
For .NET 4.6.2 or lower, .NET Core 1.x, and .NET Standard 1.x you need to install the NuGet package System.ValueTuple
:
Install-Package "System.ValueTuple"
Or using a package reference in VS 2017:
<PackageReference Include="System.ValueTuple" Version="4.4.0" />
.NET Framework 4.7, .NET Core 2.0, and .NET Standard 2.0 include these types.
It's part of the .NET Framework 4.7
.
As long as you don't target the above framework or higher (or .NET Core 2.0
/ .NET Standard 2.0
), you'll need to reference ValueTuple
. Do this by adding the System.ValueTuple
NuGet Package
The ValueTuple types are built into newer frameworks:
- .NET Framework 4.7
- .NET Core 2.0
- Mono 5.0
- .Net Standard 2.0
Until you target one of those newer framework versions, you need to reference the ValueTuple package.
More details at http://blog.monstuff.com/archives/2017/03/valuetuple-availability.html