Getting "Tuple element name is inferred. Please use language version 7.1 or greater to access an element by its inferred name."

Jessica picture Jessica · Aug 15, 2017 · Viewed 8.7k times · Source

We have the following code that has been working fine in our UWP app until today after we updated Visual Studio 2017 to the latest 15.3.

private void Test()
{
    var groups = new List<(Guid key, IList<(string, bool)> items)>();

    var items = new List<(string, bool)>
    {
        ("a", true),
        ("b", false),
        ("c", false)
    };
    var group = (Guid.NewGuid(), items);

    groups.Add(group);
}

There is no error message but this in the output window

Tuple element name 'items' is inferred. Please use language version 7.1 or greater to access an element by its inferred name.

Any idea why and how to fix this?

Answer

John Stewien picture John Stewien · Aug 16, 2017

Project->Properties->Build->Advanced->Language Version->C# latest Minor Version