@@ -1618,8 +1618,16 @@ let OutputDiagnosticContext prefix fileLineFn os err =
16181618let GetFSharpCoreLibraryName () = " FSharp.Core"
16191619
16201620// If necessary assume a reference to the latest .NET Framework FSharp.Core with which those tools are built.
1621- let GetDefaultFSharpCoreReference () =
1622- typeof< list< int>>. Assembly.Location
1621+ let GetDefaultFSharpCoreReference () = typeof< list< int>>. Assembly.Location
1622+
1623+ // If necessary assume a reference to the latest System.ValueTuple with which those tools are built.
1624+ let GetDefaultSystemValueTupleReference () =
1625+ try
1626+ let asm = typeof< System.ValueTuple< int, int>>. Assembly
1627+ if asm.FullName.StartsWith" System.ValueTuple" then
1628+ Some asm.Location
1629+ else None
1630+ with _ -> None
16231631
16241632let GetFsiLibraryName () = " FSharp.Compiler.Interactive.Settings"
16251633
@@ -1654,7 +1662,9 @@ let DefaultReferencesForScriptsAndOutOfProjectSources(assumeDotNetFramework) =
16541662yield " System.Runtime.Numerics" // BigInteger
16551663yield " System.Threading" // OperationCanceledException
16561664// always include a default reference to System.ValueTuple.dll in scripts and out-of-project sources
1657- yield " System.ValueTuple"
1665+ match GetDefaultSystemValueTupleReference() with
1666+ | None-> ()
1667+ | Some v-> yield v
16581668
16591669yield " System.Web"
16601670yield " System.Web.Services"