I am trying to use the new Tuple features of C# 7, and running into a little bit of an issue. Actually, they were working fine, and I am not sure what changed to make them break.
I am working with an ASP.Net 4
, MVC 5
, targeting .net framework 4.6.1
So in order to use tuples I had to a the Nuget Package 'System.ValueTuple'
. Without it, the project won't compile. It worked fine for a while. Then today when I load any page that uses Tuples I get
Compiler Error Message: CS0433: The type 'ValueTuple<T1, T2>' exists in both 'System.ValueTuple, Version=4.0.2.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' and 'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
The project compiles fine, and if I remove System.ValueTuple
then it doesn't compile. But when I run it in a web page I get this error.
My searches on google suggest that ValueTuple
was added to .net 4.7
but I have no reference to 4.7 anywhere in my project and I am not compiling against 4.7. My VS 2017 doesn't even have that option.