Compil error CS8179 using a "tuple" after updating Visual Studio and SDK 5.0.202

Hans van Meurs 6 Reputation points
2021-04-18T22:11:18.057+00:00

I updatet my Visual Studio 2019 and the SDK 5.0.202.

But now I get compile errors using tuples:
The error shown: "Error CS8179 Predefined type 'System.ValueTuple`3' is not defined or imported"
I program in C#.

The statement I typed is:
public (string, int, double?) getMyFact(int? fact, string documentType)
note: "double?" is a nullable double.

Before the Visual Studio and SDK update this was no problem and was compiled correctly.
What goes wrong? What should I do to get this statement compiled properly?

Thnx!

C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,995 questions
{count} votes

1 answer

Sort by: Most helpful
  1. Hans van Meurs 6 Reputation points
    2021-04-19T21:59:37.753+00:00

    Thanks for both reply's.

    I think I do not quite understand the difference between the Visual Studio version and the SDK-version. Even don't know what the relation between those two is.

    However, I got the problem solved by searching the folders for the references to the version and:

    • downloading the 4.8 version explicitely, rather than the 5.0.202;
    • in the files "App.config" and "MyProject.csproj":
      change the references "4.6.1" (or others) into "4.8";
    • delete the hidden folder ".vs"

    Now starting Visual Studio and compiling succeeded!

    Thanks for all assistance!
    Hans

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.