anchor.diff:  open System.Threading
   open System.Text.RegularExpressions
   open System.Xml.Linq
  +open Yaaf.FSharp.Scripting
   
   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\"
   
  
positive.code:                     cacheDir.GetFiles()
                      |> Seq.filter(fun file -> 
                          let oldScriptName, _ = getScriptAndHash(file.Name)
                          oldScriptName = scriptFileName.Value)
  
                  if (oldFiles |> Seq.length) > 0 then
                      if cleanCache then
  
negative.code:             assemVersionValidCount = Seq.length cacheConfig.Value.Assemblies
          else
              false
      { ScriptFileName = scriptFileName
        AssemblyPath = assemblyPath
        AssemblyWarningsPath = assemblyWarningsPath
        CacheConfigPath = cacheConfigPath
        CacheConfig = cacheConfig
        IsValid = cacheValid }
  
  /// Run the given FAKE script with fsi.exe at the given working directory. Provides full access to Fsi options and args. Redirect output and error messages.
  let internal runFAKEScriptWithFsiArgsAndRedirectMessages printDetails (FsiArgs(fsiOptions, scriptPath, scriptArgs)) env onErrMsg onOutMsg useCache cleanCache =
  
      if printDetails then traceFAKE "Running Buildscript: %s" scriptPath
  
      // Add arguments to the Environment
      for (k,v) in env do
        Environment.SetEnvironmentVariable(k, v, EnvironmentVariableTarget.Process)
  
      // Create an env var that only contains the build script args part from the --fsiargs (or "").
      Environment.SetEnvironmentVariable("fsiargs-buildscriptargs", String.Join(" ", scriptArgs))
  
      let options =
          (FsiOptions.Default.AsArgs |> Array.toList) @ fsiOptions
          |> FsiOptions.ofArgs
  
      let handleException (ex : Exception) =
          onErrMsg (ex.ToString())
  
      let scriptPath =
          if Path.IsPathRooted scriptPath then
              scriptPath
          else
              Path.Combine(Directory.GetCurrentDirectory(), scriptPath)
  
      let cacheInfo = getCacheInfoFromScript printDetails fsiOptions scriptPath
      let getScriptAndHash fileName =
          let matched = hashRegex.Match(fileName)
          matched.Groups.Item("script").Value, matched.Groups.Item("hash").Value
  
      if useCache && cacheInfo.IsValid then
          
          if printDetails then trace "Using cache"
          let noExtension = Path.GetFileNameWithoutExtension(cacheInfo.ScriptFileName)
  
          let startString = "<StartupCode$FSI_"
          let endString =
            sprintf "_%s%s$%s"
              (noExtension.Substring(0, 1).ToUpper())
              (noExtension.Substring(1))
              (Path.GetExtension(cacheInfo.ScriptFileName).Substring(1))
          let fullName i = sprintf "%s%s>.$FSI_%s%s" startString i i endString
          let exampleName = fullName "0001"
          let parseName (n:string) =
              if n.Length >= exampleName.Length &&
                 n.Substring(0, startString.Length) = startString &&
                 n.Substring(n.Length - endString.Length) = endString then
                  let num = n.Substring(startString.Length, 4)
                  assert (fullName num = n)
                  Some (num)
              else None
          try
              match Reflection.Assembly.LoadFrom(cacheInfo.AssemblyPath)
                    .GetTypes()
                    |> Seq.filter (fun t -> parseName t.FullName |> Option.isSome)
                    |> Seq.tryHead with
              | Some mainModule ->
                try
                    mainModule.InvokeMember(
                        "main@",
                        BindingFlags.InvokeMethod ||| BindingFlags.Public ||| BindingFlags.Static,
                        null, null, [||])
                    |> ignore
                    true
                with
                | ex ->
                    handleException ex
                    false
              | None -> failwithf "We could not find a type similar to '%s' in the cached assembly!" exampleName
          finally
              try
                  traceFAKE "%s" (File.ReadAllText cacheInfo.AssemblyWarningsPath)
              with e -> traceError (e.ToString())
      else
          let cacheDir = DirectoryInfo(Path.Combine(".",".fake"))
          if useCache then
  