anchor.diff:      member __.ActualVersion = actualVersion
       member __.NotifyFileTypeCheckStateIsDirtyType = 
           // only valid when version is 4.3.0.0
  -        asm.GetType("Microsoft.FSharp.Compiler.SourceCodeServices.NotifyFileTypeCheckStateIsDirty")
  +        asmCompiler.GetType("Microsoft.FSharp.Compiler.SourceCodeServices.NotifyFileTypeCheckStateIsDirty")
       member __.SourceTokenizer = sourceTokenizerType
       member __.TokenInformation = tokenInformationType
       
  +    /// Set the currently loaded FSharpCompiler wrapper to a wrapper that
  +    /// wraps the specified library. This allows it to be used with any library
  +    /// (including non-standard builds of the F# compiler)
  +    static member BindToAssembly(asmCompiler:Assembly, asmCompilerServer) =
  +        // Infer the version of F# compiler from the FSharp.Compiler.dll
  +        let fsVersion =
  +          if null <> asmCompiler.GetType("Microsoft.FSharp.Compiler.SourceCodeServices.NotifyFileTypeCheckStateIsDirty") 
  +            then FSharp_3_0 else FSharp_2_0
  +        currentWrapper <- FSharpCompiler(asmCompiler, asmCompilerServer, fsVersion)
  +
  +    /// Create an instance of FSharpCompiler automatically (by searching
  +    /// for an appropriate assembly) using the specified required version
  +    static member FromVersion(reqVersion:FSharpCompilerVersion) =      
  +
  +        let otherVersion = 
  +            match reqVersion with FSharp_2_0 -> FSharp_3_0 | FSharp_3_0 -> FSharp_2_0
  +
  +        let checkVersion (ver:FSharpCompilerVersion) (ass:System.Reflection.Assembly) = 
  +            if ass = null then failwith (sprintf "no assembly found, wanted verion %s" (ver.ToString())) else
  +            let nm = ass.GetName()
  +            if nm = null then failwith (sprintf "no assembly name found, wanted verion %s" (ver.ToString())) 
  +            elif nm.Name = null then failwith (sprintf "no assembly name property Name found, nm = %s, wanted verion %s" (nm.ToString()) (ver.ToString()))
  +            elif nm.Version.ToString() <> ver.ToString() then failwith (sprintf "loaded %s, but had wrong version, wanted %s, got %s" nm.Name (ver.ToString()) (nm.Version.ToString()))
  +            else ass
  +
  +        let tryVersion (ver:FSharpCompilerVersion) = 
  +             Debug.WriteLine(sprintf "Resolution: Loading FSharp Compiler DLL version %A" ver)
  +             // Somewhat surprisingly, Load() and LoadWithPartialName() can still return
  +             // assemblies with the wrong version, if the right version is not available....
  +             try 
  +               // Try getting the assemblies using the microsoft strong name
  +               Debug.WriteLine("Resolution: Looking in GAC...")
  +               let asmCompiler = Assembly.Load("FSharp.Compiler, Version="+ver.ToString()+", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") |> checkVersion ver
  +               let asmCompilerServer = Assembly.Load("FSharp.Compiler.Server.Shared, Version="+ver.ToString()+", Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a") |> checkVersion ver
  +               asmCompiler,asmCompilerServer,ver
  +             with _ -> 
  +               try 
  +                 // Try getting the assemblies by partial name. 
  +                 Debug.WriteLine(sprintf "Resolution: Looking with partial name...")
  +                 let asmCompiler = Assembly.LoadWithPartialName("FSharp.Compiler, Version="+ver.ToString()) |> checkVersion ver
  +                 let asmCompilerServer = Assembly.LoadWithPartialName("FSharp.Compiler.Server.Shared, Version="+ver.ToString()) |> checkVersion ver
  +                 asmCompiler,asmCompilerServer,ver
  +               with err -> 
  +                 match FSharpEnvironment.BinFolderOfDefaultFSharpCompiler(ver) with
  +                 | None -> raise err
  +                 | Some dir -> 
  +                 // Try getting the assemblies by location
  +                 Debug.WriteLine(sprintf "Resolution: Looking in compiler directory '%s'..." dir)
  +                 let asmCompiler = Assembly.LoadFrom(Path.Combine(dir, "FSharp.Compiler.dll")) |> checkVersion ver
  +                 let asmCompilerServer = Assembly.LoadFrom(Path.Combine(dir, "FSharp.Compiler.Server.Shared.dll")) |> checkVersion ver
  +             
  +                 asmCompiler,asmCompilerServer,ver
  +
  +        let asm,asm2,actualVersion = 
  +            // Try thre required version first, otherwise try other version
  +            try tryVersion reqVersion 
  +            with e -> 
  +                match (try Some (tryVersion otherVersion) with e -> None) with 
  +                | Some res -> res 
  +                | None -> reraise()
  +
  +        FSharpCompiler(asm, asm2, actualVersion) 
   
   
       // We support multiple backend FSharp.Compiler.dll. 
  
positive.code:       /// file.
        member x.TypeCheckSource( parsed:UntypedParseInfo, filename:string, fileversion:int, source:string, options:CheckOptions, (IsResultObsolete f)) =
          let isResultObsolete = 
              let fsc = FSharpCompiler.LatestAvailable
              let f2 = fsc.MakeFunction(fsc.UnitType,typeof<bool>, Converter<obj,obj>(fun obj -> f () |> box))
              fsc.IsResultObsoleteType?NewIsResultObsolete(f2)
          let res : obj = 
              let fsc = FSharpCompiler.LatestAvailable
              match fsc.ActualVersion with 
              | FSharp_2_0 -> wrapped?TypeCheckSource(parsed.Wrapped, filename, fileversion, source, options.Wrapped, isResultObsolete ) 
              | FSharp_3_0 -> wrapped?TypeCheckSource(parsed.Wrapped, filename, fileversion, source, options.Wrapped, isResultObsolete, null (* textSnapshotInfo *) ) 
  
negative.code:   type TypeCheckInfo(wrapped:obj) =
      /// Resolve the names at the given location to a set of declarations
      member x.GetDeclarations(pos:Position, line:string, (names,residue), tokentag:int, timeout:int) =
        let fsc = FSharpCompiler.Current
        let names = fsc.MakeList(typeof<string>, names)
        let namesAndResidue = fsc.MakePair(fsc.MakeListType(typeof<string>), typeof<string>, names, residue)
        let res = 
  