Home > Backend Development > C++ > Why is 'Predefined type 'System.ValueTuple' Unavailable' in Visual Studio 15 and how can I fix it?

Why is 'Predefined type 'System.ValueTuple' Unavailable' in Visual Studio 15 and how can I fix it?

Barbara Streisand
Release: 2024-12-28 18:13:16
Original
277 people have browsed it

Why is

Predefined Type 'System.ValueTuple' Unavailable

In Visual Studio 15 Preview 3, users face a compilation error when utilizing the new tuple feature. The error message reads, "Predefined type 'System.ValueTuple´2´ is not defined or imported."

Cause and Solution:

This issue arises when using .NET 4.6.2 or lower, .NET Core 1.x, or .NET Standard 1.x. To resolve this, install the NuGet package System.ValueTuple using the following command in PowerShell:

Install-Package "System.ValueTuple"
Copy after login

For Visual Studio 2017, use a package reference:

<PackageReference Include="System.ValueTuple" Version="4.4.0" />
Copy after login

For .NET Framework 4.7, .NET Core 2.0, and .NET Standard 2.0, these types are included by default.

The above is the detailed content of Why is 'Predefined type 'System.ValueTuple' Unavailable' in Visual Studio 15 and how can I fix it?. For more information, please follow other related articles on the PHP Chinese website!

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template