anchor.diff:              allSources <- filename :: allSources
       
       let AppendClosureInformation filename =
  -        if isScriptCompilation && IsScript filename then 
  -
  -            // Pre-infer the target framework from the script
  -            let sourceText = File.ReadAllText filename
  -            let source = SourceText.ofString sourceText
  +        if IsScript filename then 
  +
  +            // Get the source to infer the target framework from any #targetfx declarations in the script
  +            let source = SourceText.ofString (File.ReadAllText filename)
   
               // Do we assume .NET Framework references for scripts? In the absence of either explicit argument
               // or an explicit #targetfx declaration, then for compilation and analysis the default
  
positive.code:         |> List.map combineFilePath
          
      // Script compilation is active if the last item being compiled is a script and --noframework has not been specified
      let isScriptCompilation = 
          let lastIsScript =
              match List.tryLast commandLineSourceFiles with 
              | Some f -> IsScript f
              | _ -> false
          lastIsScript && tcConfigB.framework
  
      let mutable allSources = []       
      
      let AddIfNotPresent(filename: string) =
  
negative.code:                     (fun _ -> ()), defaultToDotNetFramework, 
                      tcConfigB.tryGetMetadataSnapshot, tcConfigB.reduceMemoryUsage, dependencyProvider)
  
              // Record the new references (non-framework) references from the analysis of the script. (The full resolutions are recorded
              // as the corresponding #I paths used to resolve them are local to the scripts and not added to the tcConfigB - they are
              // added to localized clones of the tcConfigB).
              let references =
                  loadClosure.References
                  |> List.collect snd
                  |> List.filter (fun r -> not (Range.equals r.originalReference.Range range0) && not (Range.equals r.originalReference.Range rangeStartup))
  
              references |> List.iter (fun r -> tcConfigB.AddReferencedAssemblyByPath(r.originalReference.Range, r.resolvedPath))
  
              // Also record the other declarations from the script.
              loadClosure.NoWarns |> List.collect (fun (n, ms) -> ms|>List.map(fun m->m, n)) |> List.iter (fun (x,m) -> tcConfigB.TurnWarningOff(x, m))
              loadClosure.SourceFiles |> List.map fst |> List.iter AddIfNotPresent
              loadClosure.AllRootFileDiagnostics |> List.iter diagnosticSink
  
              // If there was an explicit #targetfx in the script then push that as a requirement into the overall compilation and add all the framework references implied
              // by the script too.
              match loadClosure.InferredTargetFramework.WhereInferred with
              | Some m ->
                  tcConfigB.CheckExplicitFrameworkDirective(loadClosure.InferredTargetFramework.InferredFramework, m)
                  tcConfigB.primaryAssembly <- loadClosure.InferredTargetFramework.InferredFramework.PrimaryAssembly
                  tcConfigB.fxResolver <- FxResolver(tcConfigB.reduceMemoryUsage, tcConfigB.tryGetMetadataSnapshot, Some loadClosure.InferredTargetFramework.UseDotNetFramework)
                  if tcConfigB.framework then
                      let references = loadClosure.References |> List.collect snd
                      references |> List.iter (fun r -> tcConfigB.AddReferencedAssemblyByPath(r.originalReference.Range, r.resolvedPath))
              | None -> ()
              
          else AddIfNotPresent filename
           
  