Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

Error CS8179 when you debug an application on a computer that has .NET Framework 4.7 installed


View products that this article applies to.

Symptoms

Assume that you have an application on a computer that has the .NET Framework 4.7 installed. The application targets the .NET Framework 4.6 and involves tuples (assume that you have added a reference to a ValueTuple package). 

When you debug this application, error CS8179 occurs in the Expression Evaluator (Immediate Window, Watch, QuickWatch) type. This is because the compiler found two instances of the well-known type that are ambiguous.

Note This issue also occurs in scripting and the Interactive Window.

↑ Back to the top


Cause

This error occurs because the implementation of ValueTuple types is included in the different assemblies that are loaded by the application.

Both Expression Evaluator and the scripting engines load the assemblies that are referenced by the application. This means that ValueTuple.dll and Mscorlib.dll (4.7) are loaded, and both include an implementation of ValueTuple types. The implementations of ValueTuple types do not unify.

↑ Back to the top


Workaround

To work around this issue, recompile the application against the .NET Framework 4.7 instead of the .NET Framework 4.6 or earlier versions, and then remove the reference to the ValueTuple package, if possible. After you do this, only one implementation of ValueTuple will be present.

Note A fix for this issue is expected in a future release of the .NET Framework.

For more information about known issues in the .NET Framework 4.7, see Known issues for the .NET Framework 4.7.

↑ Back to the top


Keywords: kbbug, kbexpertiseadvanced, kbsurveynew

↑ Back to the top

Article Info
Article ID : 4015416
Revision : 11
Created on : 4/5/2017
Published on : 4/5/2017
Exists online : False
Views : 457