Package Description
License
—
Deps
13
Install Size
—
Vulns
✓ 0
Published
Feb 2, 2026
$ dotnet add package Net4x.ValueTupleCompatibility shims and minimal implementation of System.ValueTuple and related compiler attributes for older .NET frameworks.
This project provides lightweight types and attributes that make it possible to use C# tuple syntax ((T1, T2)) and tuple element names in projects that target older .NET Framework versions which don't include the built-in System.ValueTuple types.
ValueTuple support to legacy frameworksTupleElementNamesAttribute and other compiler-support attributes required for named tuplesThis repository includes builds for multiple target frameworks, for example:
(See the project files for the exact TFMs used by each project configuration.)
Install the package from NuGet (if published) or add the source project to your solution.
Using the Package Manager Console:
Install-Package Net4x.ValueTuple
Or using dotnet (when applicable):
dotnet add package Net4x.ValueTuple
If you are consuming the project as source, add the Net4x.ValueTuple project to your solution and reference it from your projects targeting legacy frameworks.
After referencing the library you can use tuple syntax and named tuples in code that targets older frameworks. Example:
// Example method returning a tuple
public (int Id, string Name) GetPerson()
{
return (42, "Alice");
}
// Deconstructing a tuple
var (id, name) = GetPerson();
Console.WriteLine($"Id={id}, Name={name}");
Keep in mind that language support for tuple syntax comes from the C# compiler; this package provides the runtime types and attributes needed for older frameworks.
Open the solution in Visual Studio and build normally. For SDK-style or compatible projects you can also use:
dotnet build
Note: Some older-targeting projects require building with Visual Studio because they use older project formats and toolsets.
Contributions, bug reports and pull requests are welcome. Please follow these guidelines:
This project is licensed under the Apache-2.0 license. See the LICENSE.txt file for details.