Search code examples
c#visual-studiovisual-studio-2017c#-7.0c#-7.3

Error CS8107: Feature 'tuple equality' is not available in C# 7.0. Please use language version 7.3 or greater


I have the lastest Visual Studio 2017 version

My Visual Studio version

I have tried:

  • Specifically set C# Version project to 7.3 enter image description here

  • Specifically set C# Version project to latest

  • to manually modified the .csproj of the project (to latest and to C# 7.3)
  • Updated the Visual Studio version
  • Used .NET Framework 4.7 instead of 4.7.2
  • to install the ValueTuple Package (which I uninstalled right after)
  • to install Microsoft.Net Compilers package

After all these, my project still does not seems to compile in C# 7.3 because when I try to compare two tuples in the debugger, it prompts this error message:

The error message I get when I use the debugger

which translates to: Error CS8107: Feature 'tuple equality' is not available in C# 7.0. Please use language version 7.3 or greater

And here is my code:

 (CRiverGameState, int, bool) osti;
 bool canRaise = _gameState.GetLstAllowedActionsForCurrentPlayer().Contains(ActionsPossible.Raise);
 (CRiverGameState, int, bool) riverKey = (riverGameState, (int)_boardType, canRaise);

 foreach(var tabarnak in CDBHelper.PRiverAllGameStatesFoldStats.Keys)
 {
   if (tabarnak.Item1.PID == 2592 && tabarnak.Item2 == 1089 && tabarnak.Item3 == false)
     osti = tabarnak;
 }

I'm out of ideas. Why is my project compiled in C# 7.0 instead of C# 7.3 ?


Solution

  • Your debugger version uses C# 7.0.

    Your project is using C# 7.3, but the debugger is using C# 7.0.

    If you do:

    bool result = (osti == riverKey); // This will return true, but not in the debugger 
    

    This will work.