Tuples not working? (Predefined type System.ValueTuple is declared in multiple references)

I just installed the latest Visual Studio 2017 and LINQPad v5.31 on a new computer, but my existing LINQPad queries and any new queries I create that make use of the new C# tuple syntax do not work.

CS8137 Cannot define a class or member that utilizes tuples because the compiler required type 'System.Runtime.CompilerServices.TupleElementNamesAttribute' cannot be found. Are you missing a reference?

CS8356 Predefined type 'System.ValueTuple`2' is declared in multiple referenced assemblies: 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' and 'System.ValueTuple, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

I find this odd because I get the same message regardless of whether or not I add the ValueTuple package to my query. This used to "just work" so I'm a little stumped. Works fine in Visual Studio. I don't recall ever having to try to manually add the assembly with System.Runtime.CompilerServices.TupleElementNamesAttribute.

Comments

  • Do you have any references to System.ValueTuple in My Extensions, or in the plugins folder (Edit | Preferences | Folders). And when you press F4, does anything show in references?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!