anchor.diff:      member internal fsc.InternalGenerateFullPathToTool() = fsc.GenerateFullPathToTool()  // expose for unit testing
       member internal fsc.BaseExecuteTool(pathToTool, responseFileCommands, commandLineCommands) =  // F# does not allow protected members to be captured by lambdas, this is the standard workaround
           base.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands)
  +
       /// Intercept the call to ExecuteTool to handle the host compile case.
       override fsc.ExecuteTool(pathToTool, responseFileCommands, commandLineCommands) =
           let host = box fsc.HostObject
  
positive.code: 
      override fsc.GenerateCommandLineCommands() =
          let builder = new FscCommandLineBuilder()
  
          if not (String.IsNullOrEmpty(dotnetFscCompilerPath)) then builder.AppendSwitch(dotnetFscCompilerPath)
  
          // OutputAssembly
          builder.AppendSwitchIfNotNull("-o:", outputAssembly)
          // CodePage
          builder.AppendSwitchIfNotNull("--codepage:", codePage)
          // Debug
          if debugSymbols then
              builder.AppendSwitch("-g")
          // DebugType
          builder.AppendSwitchIfNotNull("--debug:", 
              if debugType = null then null else
                  match debugType.ToUpperInvariant() with
                  | "NONE"     -> null
                  | "PORTABLE" -> "portable"
                  | "PDBONLY"  -> "pdbonly"
                  | "FULL"     -> "full"
                  | _          -> null)
          // NoFramework
          if noFramework then 
              builder.AppendSwitch("--noframework") 
          // BaseAddress
          builder.AppendSwitchIfNotNull("--baseaddress:", baseAddress)
          // DefineConstants
          for item in defineConstants do
              builder.AppendSwitchIfNotNull("--define:", item.ItemSpec)          
          // DocumentationFile
          builder.AppendSwitchIfNotNull("--doc:", documentationFile)
          // GenerateInterfaceFile
          builder.AppendSwitchIfNotNull("--sig:", generateInterfaceFile)
          // KeyFile
          builder.AppendSwitchIfNotNull("--keyfile:", keyFile)
          // Optimize
          if optimize then
              builder.AppendSwitch("--optimize+")
          else
              builder.AppendSwitch("--optimize-")
          if not tailcalls then
              builder.AppendSwitch("--tailcalls-")
          // PdbFile
          builder.AppendSwitchIfNotNull("--pdb:", pdbFile)
          // Platform
          builder.AppendSwitchIfNotNull("--platform:", 
              let ToUpperInvariant (s:string) = if s = null then null else s.ToUpperInvariant()
              match ToUpperInvariant(platform), prefer32bit, ToUpperInvariant(targetType) with
                  | "ANYCPU", true, "EXE"
                  | "ANYCPU", true, "WINEXE" -> "anycpu32bitpreferred"
                  | "ANYCPU",  _, _  -> "anycpu"
                  | "X86"   ,  _, _  -> "x86"
                  | "X64"   ,  _, _  -> "x64"
                  | "ITANIUM", _, _  -> "Itanium"
                  | _         -> null)
          // Resources
          for item in resources do
              builder.AppendSwitchIfNotNull("--resource:", item.ItemSpec)
          // VersionFile
          builder.AppendSwitchIfNotNull("--versionfile:", versionFile)
          // References
          for item in references do
              builder.AppendSwitchIfNotNull("-r:", item.ItemSpec)
          // ReferencePath
          let referencePathArray = // create a array of strings
              match referencePath with
              | null -> null
              | _ -> referencePath.Split([|';'; ','|], StringSplitOptions.RemoveEmptyEntries)
                    
          builder.AppendSwitchIfNotNull("--lib:", referencePathArray, ",")   
          // TargetType
          builder.AppendSwitchIfNotNull("--target:", 
              if targetType = null then null else
                  match targetType.ToUpperInvariant() with
                  | "LIBRARY" -> "library"
                  | "EXE" -> "exe"
                  | "WINEXE" -> "winexe" 
                  | "MODULE" -> "module"
                  | _ -> null)
          
          // NoWarn
          match disabledWarnings with
          | null -> ()
          | _ -> builder.AppendSwitchIfNotNull("--nowarn:", disabledWarnings.Split([|' '; ';'; ','; '\r'; '\n'|], StringSplitOptions.RemoveEmptyEntries), ",")
          
          // WarningLevel
          builder.AppendSwitchIfNotNull("--warn:", warningLevel)
  
          // TreatWarningsAsErrors
          if treatWarningsAsErrors then
              builder.AppendSwitch("--warnaserror")
  
          // WarningsAsErrors
          // Change warning 76, HashReferenceNotAllowedInNonScript/HashDirectiveNotAllowedInNonScript/HashIncludeNotAllowedInNonScript, into an error
          // REVIEW: why is this logic here? In any case these are errors already by default!
          let warningsAsErrorsArray =
              match warningsAsErrors with
              | null -> [|"76"|]
              | _ -> (warningsAsErrors + " 76 ").Split([|' '; ';'; ','|], StringSplitOptions.RemoveEmptyEntries)                        
  
          builder.AppendSwitchIfNotNull("--warnaserror:", warningsAsErrorsArray, ",")            
  
              
          // Win32ResourceFile
          builder.AppendSwitchIfNotNull("--win32res:", win32res)
  
          // Win32ManifestFile
          builder.AppendSwitchIfNotNull("--win32manifest:", win32manifest)
  
          // VisualStudioStyleErrors 
          if vserrors then
              builder.AppendSwitch("--vserrors")      
  
          builder.AppendSwitchIfNotNull("--LCID:", vslcid)
          if utf8output then
              builder.AppendSwitch("--utf8output")
              
          // When building using the fsc task, always emit the "fullpaths" flag to make the output easier
          // for the user to parse
          builder.AppendSwitch("--fullpaths")
  
          // When building using the fsc task, also emit "flaterrors" to ensure that multi-line error messages
          // aren't trimmed
          builder.AppendSwitch("--flaterrors")
  
          builder.AppendSwitchIfNotNull("--subsystemversion:", subsystemVersion)
          if highEntropyVA then
              builder.AppendSwitch("--highentropyva+")
          else
              builder.AppendSwitch("--highentropyva-")
  
          builder.AppendSwitchIfNotNull("--targetprofile:", targetProfile)
  
          // OtherFlags - must be second-to-last
          builder.AppendSwitchUnquotedIfNotNull("", otherFlags)
          capturedArguments <- builder.CapturedArguments()
  
          // Sources - these have to go last
          builder.AppendFileNamesIfNotNull(sources, " ")
          capturedFilenames <- builder.CapturedFilenames()
          let s = builder.ToString()
          s
  
      // expose this to internal components (for nunit testing)
      member internal fsc.InternalGenerateCommandLineCommands() =
  
negative.code:             let s = tmp.ToString()
              if s <> String.Empty then
                  srcs <- tmp.ToString() :: srcs
  
      member x.AppendSwitchIfNotNull(switch:string, values:string array, sep:string) =
          builder.AppendSwitchIfNotNull(switch, values, sep)
  