@@ -2141,7 +2141,6 @@ type TcConfigBuilder =
21412141
21422142 /// When false FSI will lock referenced assemblies requiring process restart, false = disable Shadow Copy false (*default*)
21432143 mutable shadowCopyReferences: bool
2144- mutable useSdkRefs: bool
21452144
21462145 /// A function to call to try to get an object that acts as a snapshot of the metadata section of a .NET binary,
21472146 /// and from which we can read the metadata. Only used when metadataOnly=true.
@@ -2281,7 +2280,6 @@ type TcConfigBuilder =
22812280 exename = None
22822281 copyFSharpCore = CopyFSharpCoreFlag.No
22832282 shadowCopyReferences = false
2284- useSdkRefs = true
22852283 tryGetMetadataSnapshot = ( fun _ -> None)
22862284 internalTestSpanStackReferring = false
22872285 noConditionalErasure = false
@@ -2749,7 +2747,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
27492747 member x.emitDebugInfoInQuotations = data.emitDebugInfoInQuotations
27502748 member x.copyFSharpCore = data.copyFSharpCore
27512749 member x.shadowCopyReferences = data.shadowCopyReferences
2752- member x.useSdkRefs = data.useSdkRefs
27532750 member x.tryGetMetadataSnapshot = data.tryGetMetadataSnapshot
27542751 member x.internalTestSpanStackReferring = data.internalTestSpanStackReferring
27552752 member x.noConditionalErasure = data.noConditionalErasure
@@ -2798,11 +2795,6 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
27982795 if Directory.Exists runtimeRootWPF then
27992796 yield runtimeRootWPF // PresentationCore.dll is in C:\Windows\Microsoft.NET\Framework\v4.0.30319\WPF
28002797
2801- match getFrameworkRefsPackDirectory with
2802- | Some path when Directory.Exists( path) ->
2803- yield path
2804- | _ -> ()
2805-
28062798 | ResolutionEnvironment.EditingOrCompilation _ ->
28072799#if ENABLE_ MONO_ SUPPORT
28082800 if runningOnMono then
@@ -2865,14 +2857,13 @@ type TcConfig private (data: TcConfigBuilder, validate: bool) =
28652857 ///
28662858 /// Returning true may mean that the file is locked and/or placed into the
28672859 /// 'framework' reference set that is potentially shared across multiple compilations.
2868- member tcConfig.IsSystemAssembly ( filename : string ) =
2869- try
2870- FileSystem.SafeExists filename &&
2860+ member tcConfig.IsSystemAssembly ( filename : string ) =
2861+ try
2862+ FileSystem.SafeExists filename &&
28712863 (( tcConfig.GetTargetFrameworkDirectories() |> List.exists ( fun clrRoot -> clrRoot = Path.GetDirectoryName filename)) ||
2872- ( systemAssemblies.Contains ( fileNameWithoutExtension filename)) ||
2873- isInReferenceAssemblyPackDirectory filename)
2864+ ( systemAssemblies.Contains( fileNameWithoutExtension filename)))
28742865 with _ ->
2875- false
2866+ false
28762867
28772868 // This is not the complete set of search paths, it is just the set
28782869 // that is special to F# (as compared to MSBuild resolution)
@@ -3515,15 +3506,18 @@ type TcAssemblyResolutions(tcConfig: TcConfig, results: AssemblyResolution list,
35153506 TcConfig.TryResolveLibsUsingMSBuildRules ( tcConfig, assemblyList, rangeStartup, ResolveAssemblyReferenceMode.ReportErrors)
35163507 TcAssemblyResolutions( tcConfig, resolved, unresolved @ knownUnresolved)
35173508
3518- static member GetAllDllReferences ( tcConfig : TcConfig ) = [
3509+
3510+ static member GetAllDllReferences ( tcConfig : TcConfig ) =
3511+ [
35193512 let primaryReference = tcConfig.PrimaryAssemblyDllReference()
3513+ yield primaryReference
35203514
35213515 if not tcConfig.compilingFslib then
35223516 yield tcConfig.CoreLibraryDllReference()
35233517
35243518 let assumeDotNetFramework = primaryReference.SimpleAssemblyNameIs( " mscorlib" )
3525- if tcConfig.framework then
3526- for s in defaultReferencesForScriptsAndOutOfProjectSources assumeDotNetFramework tcConfig.useSdkRefs do
3519+ if tcConfig.framework then
3520+ for s in defaultReferencesForScriptsAndOutOfProjectSources assumeDotNetFramework do
35273521 yield AssemblyReference( rangeStartup, ( if s.EndsWith( " .dll" , StringComparison.OrdinalIgnoreCase) then s else s+ " .dll" ), None)
35283522
35293523 if tcConfig.useFsiAuxLib then
@@ -4558,14 +4552,8 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu
45584552
45594553 // Note: TcImports are disposable - the caller owns this object and must dispose
45604554 let frameworkTcImports = new TcImports( tcConfigP, tcResolutions, None, None)
4561-
4562- // Fetch the primaryAssembly from the referenced assemblies otherwise
4563- let primaryAssemblyReference =
4564- let path = frameworkDLLs |> List.tryFind( fun dll -> String.Compare( Path.GetFileNameWithoutExtension( dll.resolvedPath), tcConfig.primaryAssembly.Name, StringComparison.OrdinalIgnoreCase) = 0 )
4565- match path with
4566- | Some p -> AssemblyReference( range0, p.resolvedPath, None)
4567- | None -> tcConfig.PrimaryAssemblyDllReference()
4568-
4555+
4556+ let primaryAssemblyReference = tcConfig.PrimaryAssemblyDllReference()
45694557 let primaryAssemblyResolution = frameworkTcImports.ResolveAssemblyReference( ctok, primaryAssemblyReference, ResolveAssemblyReferenceMode.ReportErrors)
45704558 let! primaryAssem = frameworkTcImports.RegisterAndImportReferencedAssemblies( ctok, primaryAssemblyResolution)
45714559 let primaryScopeRef =
@@ -4580,7 +4568,7 @@ type TcImports(tcConfigP: TcConfigProvider, initialResolutions: TcAssemblyResolu
45804568 let! _assemblies = frameworkTcImports.RegisterAndImportReferencedAssemblies ( ctok, tcResolutions.GetAssemblyResolutions())
45814569
45824570 // These are the DLLs we can search for well-known types
4583- let sysCcus =
4571+ let sysCcus =
45844572 [| for ccu in frameworkTcImports.GetCcusInDeclOrder() do
45854573 //printfn "found sys ccu %s" ccu.AssemblyName
45864574 yield ccu |]
@@ -4925,8 +4913,8 @@ module private ScriptPreprocessClosure =
49254913 filename : string , codeContext ,
49264914 useSimpleResolution , useFsiAuxLib ,
49274915 basicReferences , applyCommandLineArgs ,
4928- assumeDotNetFramework , useSdkRefs ,
4929- tryGetMetadataSnapshot , reduceMemoryUsage ) =
4916+ assumeDotNetFramework , tryGetMetadataSnapshot ,
4917+ reduceMemoryUsage ) =
49304918
49314919 let projectDir = Path.GetDirectoryName filename
49324920 let isInteractive = ( codeContext = CodeContext.CompilationAndEvaluation)
@@ -4941,7 +4929,7 @@ module private ScriptPreprocessClosure =
49414929 applyCommandLineArgs tcConfigB
49424930
49434931 match basicReferences with
4944- | None -> ( basicReferencesForScriptLoadClosure useFsiAuxLib useSdkRefs assumeDotNetFramework) |> List.iter( fun f -> tcConfigB.AddReferencedAssemblyByPath( range0, f)) // Add script references
4932+ | None -> ( basicReferencesForScriptLoadClosure useFsiAuxLib assumeDotNetFramework) |> List.iter( fun f -> tcConfigB.AddReferencedAssemblyByPath( range0, f)) // Add script references
49454933 | Some rs -> for m, r in rs do tcConfigB.AddReferencedAssemblyByPath( m, r)
49464934
49474935 tcConfigB.resolutionEnvironment <-
@@ -4954,10 +4942,8 @@ module private ScriptPreprocessClosure =
49544942 // Indicates that there are some references not in basicReferencesForScriptLoadClosure which should
49554943 // be added conditionally once the relevant version of mscorlib.dll has been detected.
49564944 tcConfigB.implicitlyResolveAssemblies <- false
4957- tcConfigB.useSdkRefs <- useSdkRefs
4958-
49594945 TcConfig.Create( tcConfigB, validate= true )
4960-
4946+
49614947 let ClosureSourceOfFilename ( filename , m , inputCodePage , parseRequired ) =
49624948 try
49634949 let filename = FileSystem.GetFullPathShim filename
@@ -5126,12 +5112,11 @@ module private ScriptPreprocessClosure =
51265112 /// Given source text, find the full load closure. Used from service.fs, when editing a script file
51275113 let GetFullClosureOfScriptText
51285114 ( ctok , legacyReferenceResolver , defaultFSharpBinariesDir ,
5129- filename , sourceText , codeContext ,
5130- useSimpleResolution , useFsiAuxLib , useSdkRefs ,
5115+ filename , sourceText ,
5116+ codeContext , useSimpleResolution , useFsiAuxLib ,
51315117 lexResourceManager : Lexhelp.LexResourceManager ,
51325118 applyCommmandLineArgs , assumeDotNetFramework ,
51335119 tryGetMetadataSnapshot , reduceMemoryUsage ) =
5134-
51355120 // Resolve the basic references such as FSharp.Core.dll first, before processing any #I directives in the script
51365121 //
51375122 // This is tries to mimic the action of running the script in F# Interactive - the initial context for scripting is created
@@ -5141,7 +5126,7 @@ module private ScriptPreprocessClosure =
51415126 CreateScriptTextTcConfig( legacyReferenceResolver, defaultFSharpBinariesDir,
51425127 filename, codeContext, useSimpleResolution,
51435128 useFsiAuxLib, None, applyCommmandLineArgs, assumeDotNetFramework,
5144- useSdkRefs , tryGetMetadataSnapshot, reduceMemoryUsage)
5129+ tryGetMetadataSnapshot, reduceMemoryUsage)
51455130
51465131 let resolutions0 , _unresolvedReferences = GetAssemblyResolutionInformation( ctok, tcConfig)
51475132 let references0 = resolutions0 |> List.map ( fun r -> r.originalReference.Range, r.resolvedPath) |> Seq.distinct |> List.ofSeq
@@ -5150,8 +5135,7 @@ module private ScriptPreprocessClosure =
51505135 let tcConfig =
51515136 CreateScriptTextTcConfig( legacyReferenceResolver, defaultFSharpBinariesDir, filename,
51525137 codeContext, useSimpleResolution, useFsiAuxLib, Some references0,
5153- applyCommmandLineArgs, assumeDotNetFramework, useSdkRefs,
5154- tryGetMetadataSnapshot, reduceMemoryUsage)
5138+ applyCommmandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage)
51555139
51565140 let closureSources = [ ClosureSource( filename, range0, sourceText, true )]
51575141 let closureFiles , tcConfig = FindClosureFiles( closureSources, tcConfig, codeContext, lexResourceManager)
@@ -5177,15 +5161,15 @@ type LoadClosure with
51775161 /// A temporary TcConfig is created along the way, is why this routine takes so many arguments. We want to be sure to use exactly the
51785162 /// same arguments as the rest of the application.
51795163 static member ComputeClosureOfScriptText
5180- ( ctok , legacyReferenceResolver , defaultFSharpBinariesDir ,
5181- filename : string , sourceText : ISourceText , codeContext , useSimpleResolution : bool ,
5182- useFsiAuxLib , useSdkRefs , lexResourceManager : Lexhelp.LexResourceManager ,
5183- applyCommmandLineArgs , assumeDotNetFramework , tryGetMetadataSnapshot , reduceMemoryUsage ) =
5164+ ( ctok , legacyReferenceResolver , defaultFSharpBinariesDir ,
5165+ filename : string , sourceText : ISourceText , codeContext , useSimpleResolution : bool ,
5166+ useFsiAuxLib , lexResourceManager : Lexhelp.LexResourceManager ,
5167+ applyCommmandLineArgs , assumeDotNetFramework , tryGetMetadataSnapshot , reduceMemoryUsage ): LoadClosure =
51845168
51855169 use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse
51865170 ScriptPreprocessClosure.GetFullClosureOfScriptText
51875171 ( ctok, legacyReferenceResolver, defaultFSharpBinariesDir, filename, sourceText,
5188- codeContext, useSimpleResolution, useFsiAuxLib, useSdkRefs , lexResourceManager,
5172+ codeContext, useSimpleResolution, useFsiAuxLib, lexResourceManager,
51895173 applyCommmandLineArgs, assumeDotNetFramework, tryGetMetadataSnapshot, reduceMemoryUsage)
51905174
51915175 /// Analyze a set of script files and find the closure of their references.
@@ -5194,7 +5178,8 @@ type LoadClosure with
51945178 lexResourceManager : Lexhelp.LexResourceManager ) =
51955179 use unwindBuildPhase = PushThreadBuildPhaseUntilUnwind BuildPhase.Parse
51965180 ScriptPreprocessClosure.GetFullClosureOfScriptFiles ( ctok, tcConfig, files, codeContext, lexResourceManager)
5197-
5181+
5182+
51985183
51995184//----------------------------------------------------------------------------
52005185// Initial type checking environment
@@ -5494,4 +5479,4 @@ let TypeCheckClosedInputSet (ctok, checkForErrors, tcConfig, tcImports, tcGlobal
54945479
54955480// Existing public APIs delegate to newer implementations
54965481let GetFSharpCoreLibraryName () = getFSharpCoreLibraryName
5497- let DefaultReferencesForScriptsAndOutOfProjectSources assumeDotNetFramework = defaultReferencesForScriptsAndOutOfProjectSources assumeDotNetFramework false
5482+ let DefaultReferencesForScriptsAndOutOfProjectSources assumeDotNetFramework = defaultReferencesForScriptsAndOutOfProjectSources assumeDotNetFramework
0 commit comments