anchor.diff:                      cacheDir.GetFiles()
                       |> Seq.filter(fun file -> 
                           let oldScriptName, _ = getScriptAndHash(file.Name)
  -                        oldScriptName = scriptFileName.Value)
  +                        oldScriptName = cacheInfo.ScriptFileName)
   
                   if (oldFiles |> Seq.length) > 0 then
                       if cleanCache then
  
positive.code: open System.Threading
  open System.Text.RegularExpressions
  open System.Xml.Linq
  
  let private FSIPath = @".\tools\FSharp\;.\lib\FSharp\;[ProgramFilesX86]\Microsoft SDKs\F#\4.0\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.1\Framework\v4.0;[ProgramFilesX86]\Microsoft SDKs\F#\3.0\Framework\v4.0;[ProgramFiles]\Microsoft F#\v4.0\;[ProgramFilesX86]\Microsoft F#\v4.0\;[ProgramFiles]\FSharp-2.0.0.0\bin\;[ProgramFilesX86]\FSharp-2.0.0.0\bin\;[ProgramFiles]\FSharp-1.9.9.9\bin\;[ProgramFilesX86]\FSharp-1.9.9.9\bin\"
  
  
negative.code:                     if printDetails then trace "Cache doesn't exist"
              else
                  if printDetails then trace "Cache doesn't exist"
  
          // Contains warnings and errors about the build script.
          let fsiErrorOutput = new System.Text.StringBuilder()
          let session =
            try ScriptHost.Create
                  (options, preventStdOut = true,
                    fsiErrWriter = ScriptHost.CreateForwardWriter
                      ((fun s ->
                          if String.IsNullOrWhiteSpace s |> not then
                              fsiErrorOutput.AppendLine s |> ignore),
                        removeNewLines = true),
                    outWriter = ScriptHost.CreateForwardWriter onOutMsg,
                    errWriter = ScriptHost.CreateForwardWriter onErrMsg)
            with :? FsiEvaluationException as e ->
                traceError "FsiEvaluationSession could not be created."
                traceError e.Result.Error.Merged
                reraise ()
  
          try
              try
                  session.EvalScript scriptPath
                  true
              with :? FsiEvaluationException as eval ->
                  // Write Script Warnings & Errors at the end
                  handleException eval
                  false
          finally
              // Write Script Warnings & Errors at the end
              traceFAKE "%O" fsiErrorOutput
              // Cache in the error case as well.
              try
                  if useCache && not cacheInfo.IsValid then
                      session.DynamicAssemblyBuilder.Save("FSI-ASSEMBLY.dll")
                      if not <| Directory.Exists cacheDir.FullName then
                          let di = Directory.CreateDirectory cacheDir.FullName
                          di.Attributes <- FileAttributes.Directory ||| FileAttributes.Hidden
  
                      let destinationFile = FileInfo(cacheInfo.AssemblyPath)
                      let targetDirectory = destinationFile.Directory
  
                      if (not <| targetDirectory.Exists) then targetDirectory.Create()
                      if (destinationFile.Exists) then destinationFile.Delete()
  
                      File.WriteAllText(cacheInfo.AssemblyWarningsPath, fsiErrorOutput.ToString())
                      File.Move("FSI-ASSEMBLY.dll", cacheInfo.AssemblyPath)
                      
                      if File.Exists("FSI-ASSEMBLY.pdb") then
                          File.Delete("FSI-ASSEMBLY.pdb")
                      if File.Exists("FSI-ASSEMBLY.dll.mdb") then
                          File.Delete("FSI-ASSEMBLY.dll.mdb")
  
                      let dynamicAssemblies =
                          System.AppDomain.CurrentDomain.GetAssemblies()
                          |> Seq.filter(fun assem -> assem.IsDynamic)
                          |> Seq.map(fun assem -> assem.GetName().Name)
                          |> Seq.filter(fun assem -> assem <> "FSI-ASSEMBLY")
                          // General Reflection.Emit helper (most likely harmless to ignore)
                          |> Seq.filter(fun assem -> assem <> "Anonymously Hosted DynamicMethods Assembly")
                          // RazorEngine generated
                          |> Seq.filter(fun assem -> assem <> "RazorEngine.Compilation.ImpromptuInterfaceDynamicAssembly")
                          |> Seq.cache
                      if dynamicAssemblies |> Seq.length > 0 then
                          let msg =
                              sprintf "Dynamic assemblies were generated during evaluation of script (%s).\nCan not save cache."
                                  (System.String.Join(", ", dynamicAssemblies))
                          trace msg
  
                      else
                          let assemblies =
                              System.AppDomain.CurrentDomain.GetAssemblies()
                              |> Seq.filter(fun assem -> not assem.IsDynamic)
                              // They are not dynamic, but can't be re-used either.
                              |> Seq.filter(fun assem -> not <| assem.GetName().Name.StartsWith("CompiledRazorTemplates.Dynamic.RazorEngine_"))
                          
                          let cacheConfig : XDocument = Cache.create assemblies
                          cacheConfig.Save(cacheInfo.CacheConfigPath)
                          if printDetails then trace (System.Environment.NewLine + "Saved cache")
              with ex ->
                  handleException ex
                  reraise()
  
  /// Run the given buildscript with fsi.exe and allows for extra arguments to the script. Returns output.
  let executeBuildScriptWithArgsAndReturnMessages script (scriptArgs: string[]) useCache cleanCache =
      let messages = ref []
      let appendMessage isError msg =
          traceUnknown msg // Some test code expects that the executed script writes to stdout
          messages := { IsError = isError
                        Message = msg
                        Timestamp = DateTimeOffset.UtcNow } :: !messages
  